diff --git a/.gitignore b/.gitignore index 6e412cf4..f398ac74 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,8 @@ src/go/pt-mongodb-query-digest/vendor/ src/go/pt-mongodb-summary/vendor/ !vendor/vendor.json vendor/ +*.bak +src/go/*.bak +config/deb/control.bak +config/rpm/percona-toolkit.spec.bak + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..41181720 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,48 @@ +language: go + +go: + - 1.9.x + +services: + - docker + +env: + matrix: + - MONGODB_IMAGE=mongo:3.0 + - MONGODB_IMAGE=mongo:3.2 + - MONGODB_IMAGE=mongo:3.4 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.0 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.2 + - MONGODB_IMAGE=percona/percona-server-mongodb:3.4 + +matrix: + include: + - go: 1.8.x + env: + - go: tip + env: + +install: + - go get -u github.com/Masterminds/glide + - glide install -v + +before_script: + # run docker containers + - docker-compose up -d + # log versions + - docker --version + - docker-compose --version + - docker-compose exec mongo mongo --version + # we need at least one document in test db + - docker-compose exec mongo mongo --eval 'db.init.insert({})' + +script: + - go test -timeout 1m $(glide nv) + +notifications: + email: false + slack: + on_success: change + on_failure: change + rooms: + secure: E5ZRDFtbVmQCo2SLCdvecpaRIZPC35+0srkyA9jVq0BJpvVY6pm4OQceAugy/g5cd6c2reTN9oNSjNF62BKpoJxPuIuu8/JdlvUMMxgxnGkCC1R6hAddbapvIe4EXlybLPGy8kAG7OkYVpGHtWwN3U5MfF7/tGeqL2y8C3fCDZA= diff --git a/Changelog b/Changelog index 300c88d3..4d37d7d4 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,31 @@ Changelog for Percona Toolkit -v3.0.3 + + * Fixed bug PT-186: pt-online-schema-change --alter fails if fields are using mixed case + +v3.0.4 released 2017-08-02 + + * Fixed bug PT-181 : pt-online-schema-change not in sync with modules (Thanks Daniël van Eeden) + * Fixed bug PT-180 : pt-online-schema-change --skip-check-slave-lag doesn't work + * Fixed bug PT-178 : pt-online-schema-change appears to ignore the --check-slave-lag option + * Fixed bug PT-162 : Updated pt-table-checksum ignored dbs (Thanks Agustin Gallego) + * Fixed bug PT-161 : Safely check for undefined values in --skip-check-slave-lag (Thanks Chris Swingler) + * Fixed bug PT-154 : pt-online-schema-change --no-use-insert-ignore is broken + * Fixed bug PT-153 : pt-online-schema-change data loss when adding unique keys + * Fixed bug PT-151 : point is not decimal + * Fixed bug PT-148 : pt-osc Use of uninitialized value in printf + * Fixed bug PT-146 : Turn off statement based binlog checks + * Fixed bug PT-144 : Constraint name is too long (> 64 chars) + * Fixed bug PT-143 : pt-archiver SELECT query fails because of primary key + * Fixed bug PT-142 : pt-online-schema-change find_child_tables slow + * Fixed bug PT-138 : Added --output-format option to pt-mongodb-summary + * Fixed bug PT-136 : pt-table-checksum fails with columns having different collation/charset + * Feature PT-173 : Enable pt-table-checksum to ensure stale data is removed + * Feature PT-141 : pt-archiver archive records into csv file + * Feature PT-91 : Make pt-osc compatible with AFTER triggers + * Feature PT-90 : pt-stalk: Collect information about prepared statements if P_S is enabled (Thanks Agustin Gallego) + +v3.0.3 released 2017-05-19 * Fixed bug PT-133 : Sandbox won't start correctly if autocommit=0 in my.cnf * Fixed bug PT-132 : pt-online-schema-change should imply --no-drop-new-table @@ -8,15 +33,17 @@ v3.0.3 * Fixed bug PT-128 : pt-stalk ps include memory usage outputs * Fixed bug PT-126 : Recognize comments in ALTER * Fixed bug PT-116 : pt-online-schema change eats data on adding a unique index. Added --[no]use-insert-ignore - * Feature PT-115 : Make DSNs params able to be repeatable * Fixed bug PT-115 : Made OptionParser to accept repeatable DSNs * Fixed bug PT-111 : Collect MySQL variables * Fixed bug PT-087 : Add --skip-check-slave-lag to pt-table-checksum * Fixed bug PT-086 : Added --skip-check-slave-lag to pt-osc * Fixed bug PT-080 : Added support for slave status in pt-stalk + * Feature PT-115 : Make DSNs params able to be repeatable v3.0.2 released 2017-03-23 + * Fixed bug PT-101 : pt-table-checksum ignores slave-user and slave-password + * Fixed bug PT-105 : pt-table-checksum fails if a database is dropped while the tool is running * Fixed bug PT-73 : pt-mongodb tools add support for SSL connections * Fixed bug PT-74 : pt-mongodb-summary Cannot get security settings when connected to a mongod instance * Fixed bug PT-75 : pt-mongodb-query-digest Change the default sort order to -count (descending) @@ -27,8 +54,6 @@ v3.0.2 released 2017-03-23 * Fixed bug PT-93 : Fix pt-mongodb-query-digest query ID (Thanks Kamil Dziedzic) * Fixed bug PT-94 : pt-online-schema-change makes duplicate rows in _t_new for UPDATE t set pk=0 where pk=1 * Fixed bug PT-96 : Fixed PT tests - * Fixed bug PT-101 : pt-table-checksum ignores slave-user and slave-password - * Fixed bug PT-105 : pt-table-checksum fails if a database is dropped while the tool is running v3.0.1 released 2017-02-16 @@ -43,15 +68,15 @@ v3.0 released 2017-02-03 v2.2.20 released 2016-12-09 * Fixed bug 1362942: pt-slave-restart fails on MariaDB 10.0.13 (gtid_mode confusion) - * Fixed bug 1566556: pt-show-grants fails against MariaDB10+ + * Fixed bug 1566556: pt-show-grants fails against MariaDB10+ * Feature 1604834: pt-query-digest numbers in table or column names converted to question marks (--preserve-embedded-numbers) * Fixed bug 1613915: pt-online-schema-change misses data. Fixed sort order for ENUM fields * Fixed bug 1625005: pt-online-schema-change doesn't apply underscores to foreign keys individually * Fixed bug 1634900: pt-upgrade fails with SELECT INTO - * Fixed bug 1635734: pt-slave-restart --config does not recognize = as separator + * Fixed bug 1635734: pt-slave-restart --config does not recognize = as separator * Feature 1636068: Added pause to NibbleIterator * Feature 1638293: --data-dir parameter in order to create the table on a different partition - * Feature 1639052: with pt-table-checksum automatically exclude checking schemas named percona, percona_schema + * Feature 1639052: with pt-table-checksum automatically exclude checking schemas named percona, percona_schema * Feature 1642364: pt-online-schema-change Added --remove-data-dir feature * Feature 1643914: Fixed several typos in the doc (Thanks Dario Minnucci) * Feature 1643940: Add Transparent huge pages info to pt-summary diff --git a/Makefile.PL b/Makefile.PL index 636669c1..7db7f5c0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'percona-toolkit', - VERSION => '3.0.2', + VERSION => '3.0.4', EXE_FILES => [ ], MAN1PODS => { 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p', diff --git a/README b/README.md similarity index 100% rename from README rename to README.md diff --git a/bin/pt-align b/bin/pt-align index b22f2114..a15d0574 100755 --- a/bin/pt-align +++ b/bin/pt-align @@ -1359,6 +1359,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-align 3.0.2 +pt-align 3.0.4 =cut diff --git a/bin/pt-archiver b/bin/pt-archiver index 9484eb45..6f6317d2 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -45,7 +45,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -1954,7 +1954,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -1965,8 +1965,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -1983,6 +1983,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -1991,24 +1996,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -2085,6 +2100,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -2092,8 +2109,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -4518,7 +4536,8 @@ sub lost_connection { my ($self, $e) = @_; return 0 unless $e; return $e =~ m/MySQL server has gone away/ - || $e =~ m/Lost connection to MySQL server/; + || $e =~ m/Lost connection to MySQL server/ + || $e =~ m/Server shutdown in progress/; } sub dbh { @@ -4537,6 +4556,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -5913,6 +5937,8 @@ my $get_sth; my ( $OUT_OF_RETRIES, $ROLLED_BACK, $ALL_IS_WELL ) = ( 0, -1, 1 ); my ( $src, $dst ); my $pxc_version = '0'; +my $fields_separated_by = "\t"; +my $optionally_enclosed_by; # Holds the arguments for the $sth's bind variables, so it can be re-tried # easily. @@ -6314,10 +6340,8 @@ sub main { # this ensures returned sets are disjoint when ran on partitioned tables # issue 1376561 my $index_cols; - if ( $sel_stmt->{index} - && $src->{info}->{keys}->{$sel_stmt->{index}}->{cols} - ) { - $index_cols = $src->{info}->{keys}->{$sel_stmt->{index}}->{colnames}; + if ( $sel_stmt->{index} && $src->{info}->{keys}->{$sel_stmt->{index}}->{cols} ) { + $index_cols = join(",",map { "`$_`" } @{$src->{info}->{keys}->{$sel_stmt->{index}}->{cols}}); } foreach my $thing ( $first_sql, $next_sql ) { @@ -6542,12 +6566,19 @@ sub main { # Open the file and print the header to it. if ( $archive_file ) { + if ($o->got('output-format') && $o->get('output-format') ne 'dump' && $o->get('output-format') ne 'csv') { + warn "Invalid output format:". $o->get('format'); + warn "Using default 'dump' format"; + } elsif ($o->get('output-format') || '' eq 'csv') { + $fields_separated_by = ", "; + $optionally_enclosed_by = '"'; + } my $need_hdr = $o->get('header') && !-f $archive_file; $archive_fh = IO::File->new($archive_file, ">>$charset") or die "Cannot open $charset $archive_file: $OS_ERROR\n"; $archive_fh->autoflush(1) unless $o->get('buffer'); if ( $need_hdr ) { - print { $archive_fh } '', escape(\@sel_cols), "\n" + print { $archive_fh } '', escape(\@sel_cols, $fields_separated_by, $optionally_enclosed_by), "\n" or die "Cannot write to $archive_file: $OS_ERROR\n"; } } @@ -6592,7 +6623,7 @@ sub main { # problem, hopefully the data has at least made it to the file. my $escaped_row; if ( $archive_fh || $bulkins_file ) { - $escaped_row = escape([@{$row}[@sel_slice]]); + $escaped_row = escape([@{$row}[@sel_slice]], $fields_separated_by, $optionally_enclosed_by); } if ( $archive_fh ) { trace('print_file', sub { @@ -7049,11 +7080,18 @@ sub do_with_retries { # described in the LOAD DATA INFILE section of the MySQL manual, # http://dev.mysql.com/doc/refman/5.0/en/load-data.html sub escape { - my ($row) = @_; - return join("\t", map { + my ($row, $fields_separated_by, $optionally_enclosed_by) = @_; + $fields_separated_by ||= "\t"; + $optionally_enclosed_by ||= ''; + + return join($fields_separated_by, map { s/([\t\n\\])/\\$1/g if defined $_; # Escape tabs etc - defined $_ ? $_ : '\N'; # NULL = \N + $_ = defined $_ ? $_ : '\N'; # NULL = \N + # var & ~var will return 0 only for numbers + $_ =~ s/([^\\])"/$1\\"/g if ($_ !~ /^[0-9,.E]+$/ && $optionally_enclosed_by eq '"'); + $_ = $optionally_enclosed_by && $_ & ~$_ ? $optionally_enclosed_by."$_".$optionally_enclosed_by : $_; } @$row); + } sub ts { @@ -7674,6 +7712,17 @@ Runs OPTIMIZE TABLE after finishing. See L<"--analyze"> for the option syntax and L for details on OPTIMIZE TABLE. +=item --output-format + +type: string + +Used with L<"--file"> to specify the output format. + +Valid formats are: + dump: MySQL dump format using tabs as field separator (default) + csv : Dump rows using ',' as separator and optionally enclosing fields by '"'. + This format is equivalent to FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'. + =item --password short form: -p; type: string @@ -8460,6 +8509,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-archiver 3.0.2 +pt-archiver 3.0.4 =cut diff --git a/bin/pt-config-diff b/bin/pt-config-diff index a24d7e55..b688de65 100755 --- a/bin/pt-config-diff +++ b/bin/pt-config-diff @@ -43,7 +43,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -2410,7 +2410,8 @@ sub lost_connection { my ($self, $e) = @_; return 0 unless $e; return $e =~ m/MySQL server has gone away/ - || $e =~ m/Lost connection to MySQL server/; + || $e =~ m/Lost connection to MySQL server/ + || $e =~ m/Server shutdown in progress/; } sub dbh { @@ -2429,6 +2430,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -2460,9 +2466,20 @@ sub is_cluster_node { my ($self, $cxn) = @_; $cxn ||= $self; + my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; - PTDEBUG && _d($cxn->name, $sql); - my $row = $cxn->dbh->selectrow_arrayref($sql); + + my $dbh; + if ($cxn->isa('DBI::db')) { + $dbh = $cxn; + PTDEBUG && _d($sql); #don't invoke name() if it's not a Cxn! + } + else { + $dbh = $cxn->dbh(); + PTDEBUG && _d($cxn->name, $sql); + } + + my $row = $dbh->selectrow_arrayref($sql); return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; } @@ -5826,6 +5843,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-config-diff 3.0.2 +pt-config-diff 3.0.4 =cut diff --git a/bin/pt-deadlock-logger b/bin/pt-deadlock-logger index 94a54603..50448b8f 100755 --- a/bin/pt-deadlock-logger +++ b/bin/pt-deadlock-logger @@ -42,7 +42,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -2754,7 +2754,8 @@ sub lost_connection { my ($self, $e) = @_; return 0 unless $e; return $e =~ m/MySQL server has gone away/ - || $e =~ m/Lost connection to MySQL server/; + || $e =~ m/Lost connection to MySQL server/ + || $e =~ m/Server shutdown in progress/; } sub dbh { @@ -2773,6 +2774,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -2804,9 +2810,20 @@ sub is_cluster_node { my ($self, $cxn) = @_; $cxn ||= $self; + my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; - PTDEBUG && _d($cxn->name, $sql); - my $row = $cxn->dbh->selectrow_arrayref($sql); + + my $dbh; + if ($cxn->isa('DBI::db')) { + $dbh = $cxn; + PTDEBUG && _d($sql); #don't invoke name() if it's not a Cxn! + } + else { + $dbh = $cxn->dbh(); + PTDEBUG && _d($cxn->name, $sql); + } + + my $row = $dbh->selectrow_arrayref($sql); return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; } @@ -5616,6 +5633,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-deadlock-logger 3.0.2 +pt-deadlock-logger 3.0.4 =cut diff --git a/bin/pt-diskstats b/bin/pt-diskstats index 3e0e2e76..1333a5f1 100755 --- a/bin/pt-diskstats +++ b/bin/pt-diskstats @@ -38,7 +38,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -5627,6 +5627,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-diskstats 3.0.2 +pt-diskstats 3.0.4 =cut diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index 8b592eb1..d82c75bc 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -39,7 +39,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -341,7 +341,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -352,8 +352,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -370,6 +370,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -378,24 +383,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -472,6 +487,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -479,8 +496,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -3549,22 +3567,15 @@ sub table_is_allowed { return 0 if $db eq 'mysql' && $tbl =~ m/^(?: general_log - |gtid_execution + |gtid_executed |innodb_index_stats |innodb_table_stats - |inventory - |plugin - |proc |slave_master_info |slave_relay_log_info |slave_worker_info |slow_log )$/x; - return 0 if $db eq 'sys' && $tbl =~ m/^(?: - sys_config - )$/x; - if ( $filter->{'ignore-tables'}->{'*'}->{$tbl} || $filter->{'ignore-tables'}->{$db}->{$tbl}) { PTDEBUG && _d('Table', $tbl, 'is in --ignore-tables list'); @@ -5685,6 +5696,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-duplicate-key-checker 3.0.2 +pt-duplicate-key-checker 3.0.4 =cut diff --git a/bin/pt-fifo-split b/bin/pt-fifo-split index 7fd5d61e..766a8ba5 100755 --- a/bin/pt-fifo-split +++ b/bin/pt-fifo-split @@ -1648,6 +1648,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-fifo-split 3.0.2 +pt-fifo-split 3.0.4 =cut diff --git a/bin/pt-find b/bin/pt-find index 4f300a53..fc02d69e 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -35,7 +35,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -1869,7 +1869,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -1880,8 +1880,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -1898,6 +1898,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -1906,24 +1911,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -2000,6 +2015,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -2007,8 +2024,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -5037,6 +5055,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-find 3.0.2 +pt-find 3.0.4 =cut diff --git a/bin/pt-fingerprint b/bin/pt-fingerprint index 0e45e58e..90745d96 100755 --- a/bin/pt-fingerprint +++ b/bin/pt-fingerprint @@ -2239,6 +2239,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-fingerprint 3.0.2 +pt-fingerprint 3.0.4 =cut diff --git a/bin/pt-fk-error-logger b/bin/pt-fk-error-logger index e94fd70b..18b2dbef 100755 --- a/bin/pt-fk-error-logger +++ b/bin/pt-fk-error-logger @@ -37,7 +37,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -1906,7 +1906,8 @@ sub lost_connection { my ($self, $e) = @_; return 0 unless $e; return $e =~ m/MySQL server has gone away/ - || $e =~ m/Lost connection to MySQL server/; + || $e =~ m/Lost connection to MySQL server/ + || $e =~ m/Server shutdown in progress/; } sub dbh { @@ -1925,6 +1926,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -1956,9 +1962,20 @@ sub is_cluster_node { my ($self, $cxn) = @_; $cxn ||= $self; + my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; - PTDEBUG && _d($cxn->name, $sql); - my $row = $cxn->dbh->selectrow_arrayref($sql); + + my $dbh; + if ($cxn->isa('DBI::db')) { + $dbh = $cxn; + PTDEBUG && _d($sql); #don't invoke name() if it's not a Cxn! + } + else { + $dbh = $cxn->dbh(); + PTDEBUG && _d($cxn->name, $sql); + } + + my $row = $dbh->selectrow_arrayref($sql); return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; } @@ -4602,6 +4619,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-fk-error-logger 3.0.2 +pt-fk-error-logger 3.0.4 =cut diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 19f7656c..5e4bd14e 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -44,7 +44,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -3508,7 +3508,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -3519,8 +3519,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -3537,6 +3537,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -3545,24 +3550,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -3639,6 +3654,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -3646,8 +3663,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -7225,6 +7243,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-heartbeat 3.0.2 +pt-heartbeat 3.0.4 =cut diff --git a/bin/pt-index-usage b/bin/pt-index-usage index b01ceff5..72b4b55c 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -45,7 +45,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -3108,7 +3108,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -3119,8 +3119,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -3137,6 +3137,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -3145,24 +3150,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -3239,6 +3254,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -3246,8 +3263,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -4327,22 +4345,15 @@ sub table_is_allowed { return 0 if $db eq 'mysql' && $tbl =~ m/^(?: general_log - |gtid_execution + |gtid_executed |innodb_index_stats |innodb_table_stats - |inventory - |plugin - |proc |slave_master_info |slave_relay_log_info |slave_worker_info |slow_log )$/x; - return 0 if $db eq 'sys' && $tbl =~ m/^(?: - sys_config - )$/x; - if ( $filter->{'ignore-tables'}->{'*'}->{$tbl} || $filter->{'ignore-tables'}->{$db}->{$tbl}) { PTDEBUG && _d('Table', $tbl, 'is in --ignore-tables list'); @@ -7615,6 +7626,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-index-usage 3.0.2 +pt-index-usage 3.0.4 =cut diff --git a/bin/pt-ioprofile b/bin/pt-ioprofile index 215739fd..a4423d9e 100755 --- a/bin/pt-ioprofile +++ b/bin/pt-ioprofile @@ -1127,7 +1127,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-ioprofile 3.0.2 +pt-ioprofile 3.0.4 =cut diff --git a/bin/pt-kill b/bin/pt-kill index 2d7612f9..48160513 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -47,7 +47,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.5'; use strict; use warnings FATAL => 'all'; @@ -2934,7 +2934,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -2945,8 +2945,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -2963,6 +2963,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -2971,24 +2976,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -3065,6 +3080,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -3072,8 +3089,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -3294,6 +3312,17 @@ sub new { foreach my $arg ( qw(MasterSlave) ) { die "I need a $arg argument" unless $args{$arg}; } + my $kill_busy_commands = {}; + if ($args{kill_busy_commands}) { + for my $command (split /,/,$args{kill_busy_commands}) { + $command =~ s/^\s+|\s+$//g; + $kill_busy_commands->{$command} = 1; + } + } else { + $kill_busy_commands->{Query} = 1; + } + $args{kill_busy_commands} = $kill_busy_commands; + my $self = { %args, polls => 0, @@ -3520,7 +3549,7 @@ sub find { next QUERY; } - if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + if ( $find_spec{busy_time} && exists($self->{kill_busy_commands}->{$query->{Command} || ''}) ) { next QUERY unless defined($query->{Time}); if ( $query->{Time} < $find_spec{busy_time} ) { PTDEBUG && _d("Query isn't running long enough"); @@ -5320,7 +5349,8 @@ sub lost_connection { my ($self, $e) = @_; return 0 unless $e; return $e =~ m/MySQL server has gone away/ - || $e =~ m/Lost connection to MySQL server/; + || $e =~ m/Lost connection to MySQL server/ + || $e =~ m/Server shutdown in progress/; } sub dbh { @@ -5339,6 +5369,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -5370,9 +5405,20 @@ sub is_cluster_node { my ($self, $cxn) = @_; $cxn ||= $self; + my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; - PTDEBUG && _d($cxn->name, $sql); - my $row = $cxn->dbh->selectrow_arrayref($sql); + + my $dbh; + if ($cxn->isa('DBI::db')) { + $dbh = $cxn; + PTDEBUG && _d($sql); #don't invoke name() if it's not a Cxn! + } + else { + $dbh = $cxn->dbh(); + PTDEBUG && _d($cxn->name, $sql); + } + + my $row = $dbh->selectrow_arrayref($sql); return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; } @@ -6788,7 +6834,7 @@ sub main { DSNParser => $dp, Quoter => "Quoter", ); - my $pl = new Processlist(MasterSlave => $ms); + my $pl = new Processlist(MasterSlave => $ms, kill_busy_commands => $o->get('kill-busy-commands')); my $qr = new QueryRewriter(); my $cxn; @@ -8198,6 +8244,21 @@ that pt-kill matched and killed a query. See also L<"--wait-before-kill"> and L<"--wait-after-kill">. +=item --kill-busy-commands + +default: Query + +group: Actions + +Comma sepatated list of commands that will be watched/killed if they ran for +more than L<"--busy-time"> seconds. Default: C + +By default, L<"--busy-time"> kills only C commands but in some cases, it +is needed to make L<"--busy-time"> to watch and kill other commands. For example, +a prepared statement execution command is C instead of C. In this +case, specifying C<--kill-busy-commands=Query,Execute> will also kill the prepared +stamente execution. + =item --kill-query group: Actions @@ -8376,6 +8437,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-kill 3.0.2 +pt-kill 3.0.4 =cut diff --git a/bin/pt-mext b/bin/pt-mext index 381c8bb1..12d8deee 100755 --- a/bin/pt-mext +++ b/bin/pt-mext @@ -574,7 +574,7 @@ NUM=1; # Split the output on empty lines and put each into a different file; eliminate # lines that don't have "real" content. -$EXT_ARGV | sed '/| Rsa/, /END PUBLIC KEY-----/d' | grep -v '^ |' | grep -v '+' | grep -v Variable_name | sed 's/|//g' \ +$EXT_ARGV | grep -v "| Rsa_public_key *|.*|$" | sed '/| Rsa/, /END PUBLIC KEY-----/d' | grep -v '^ |' | grep -v '+' | grep -v Variable_name | sed 's/|//g' \ | while read line; do if [ "$line" = "" ]; then NUM=$(($NUM + 1)) @@ -804,7 +804,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-mext 3.0.2 +pt-mext 3.0.5 =cut diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index 6827823c..df52ea59 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -929,6 +929,10 @@ collect_mysql_users () { $CMD_MYSQL $EXT_ARGV -ss -e 'SELECT COUNT(*), SUM(user=""), SUM(password=""), SUM(password NOT LIKE "*%") FROM mysql.user' 2>/dev/null } +collect_mysql_show_slave_hosts () { + $CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW SLAVE HOSTS' 2>/dev/null +} + collect_master_logs_status () { local master_logs_file="$1" local master_status_file="$2" @@ -1027,6 +1031,7 @@ collect_mysql_info () { collect_mysqld_instances "$dir/mysql-variables" > "$dir/mysqld-instances" collect_mysqld_executables "$dir/mysqld-instances" > "$dir/mysqld-executables" + collect_mysql_show_slave_hosts "$dir/mysql-slave-hosts" > "$dir/mysql-slave-hosts" local binlog="$(get_var log_bin "$dir/mysql-variables")" if [ "${binlog}" ]; then @@ -2092,6 +2097,19 @@ section_mysqld () { done < "$executables_file" } +section_slave_hosts () { + local slave_hosts_file="$1" + + [ -e "$slave_hosts_file" ] || return + + section "Slave Hosts" + if [ -s "$slave_hosts_file" ]; then + cat "$slave_hosts_file" + else + echo "No slaves found" + fi +} + section_mysql_files () { local variables_file="$1" @@ -2192,6 +2210,8 @@ report_mysql_summary () { section_mysqld "$dir/mysqld-executables" "$dir/mysql-variables" + section_slave_hosts "$dir/mysql-slave-hosts" + local user="$(get_var "pt-summary-internal-user" "$dir/mysql-variables")" local port="$(get_var port "$dir/mysql-variables")" local now="$(get_var "pt-summary-internal-now" "$dir/mysql-variables")" @@ -3139,7 +3159,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-mysql-summary 3.0.2 +pt-mysql-summary 3.0.4 =cut diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 9302aa3f..d45d5a8b 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -14,6 +14,7 @@ use warnings FATAL => 'all'; BEGIN { $INC{$_} = __FILE__ for map { (my $pkg = "$_.pm") =~ s!::!/!g; $pkg } (qw( Percona::Toolkit + VersionCompare OptionParser Lmo::Utils Lmo::Meta @@ -55,7 +56,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.5'; use strict; use warnings FATAL => 'all'; @@ -106,6 +107,54 @@ sub _d { # ########################################################################### # End Percona::Toolkit package # ########################################################################### +# + +# ########################################################################### +# VersionCompare package +# This package is a copy without comments from the original. The original +# with comments and its test file can be found in the Bazaar repository at, +# lib/VersionCompare.pm +# t/lib/VersionCompare.t +# See https://launchpad.net/percona-toolkit for more information. +# ########################################################################### +{ +package VersionCompare; + +use strict; +use English qw(-no_match_vars); +use constant PTDEBUG => $ENV{PTDEBUG} || 0; + +sub cmp { + my ($v1, $v2) = @_; + + $v1 =~ s/[^\d\.]//; + $v2 =~ s/[^\d\.]//; + + my @a = ( $v1 =~ /(\d+)\.?/g ); + my @b = ( $v2 =~ /(\d+)\.?/g ); + foreach my $n1 (@a) { + $n1 += 0; #convert to number + if (!@b) { + return 1; + } + my $n2 = shift @b; + $n2 += 0; # convert to number + if ($n1 == $n2) { + next; + } + else { + return $n1 <=> $n2; + } + } + return @b ? -1 : 0; +} + + +1; +} +# ########################################################################### +# End VersionCompare package +# ########################################################################### # ########################################################################### # OptionParser package @@ -2150,7 +2199,7 @@ sub parse { foreach my $key ( keys %$opts ) { PTDEBUG && _d('Finding value for', $key); $final_props{$key} = $given_props{$key}; - if ( !defined $final_props{$key} + if ( !defined $final_props{$key} && defined $prev->{$key} && $opts->{$key}->{copy} ) { $final_props{$key} = $prev->{$key}; @@ -3249,7 +3298,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -3260,8 +3309,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -3278,6 +3327,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -3286,24 +3340,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -3948,6 +4012,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -4884,24 +4953,6 @@ sub wait { my $worst; # most lagging slave my $pr_callback; my $pr_first_report; - - my $pr_refresh_slave_list = sub { - my ($self) = @_; - my ($slaves, $refresher) = ($self->{slaves}, $self->{get_slaves_cb}); - return if ( not defined $refresher ); - my $before = join ' ', sort map {$_->name()} @$slaves; - $slaves = $refresher->(); - my $after = join ' ', sort map {$_->name()} @$slaves; - if ($before ne $after) { - $self->{slaves} = $slaves; - printf "Slave set to watch has changed\n Was: %s\n Now: %s\n", - $before, $after; - } - return($self->{slaves}); - }; - - $slaves = $pr_refresh_slave_list->($self); - if ( $pr ) { $pr_callback = sub { my ($fraction, $elapsed, $remaining, $eta, $completed) = @_; @@ -4929,14 +4980,6 @@ sub wait { my @lagged_slaves = map { {cxn=>$_, lag=>undef} } @$slaves; while ( $oktorun->() && @lagged_slaves ) { PTDEBUG && _d('Checking slave lag'); - - $slaves = $pr_refresh_slave_list->($self); - my $watched = 0; - @lagged_slaves = grep { - my $slave_name = $_->{cxn}->name(); - grep {$slave_name eq $_->name()} @{$slaves || []} - } @lagged_slaves; - for my $i ( 0..$#lagged_slaves ) { my $lag = $get_lag->($lagged_slaves[$i]->{cxn}); PTDEBUG && _d($lagged_slaves[$i]->{cxn}->name(), @@ -4978,9 +5021,6 @@ sub wait { sub _d { my ($package, undef, $line) = caller 0; - # Backslash found where operator expected at ./pt-online-schema-change line 4933, near "@_ = map { (my $temp = $_) =~ s/\" - # (Might be a runaway multi-line // string starting on line 4889) - @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; } map { defined $_ ? $_ : 'undef' } @_; @@ -5233,7 +5273,7 @@ sub wait { die "$var=$val exceeds its critical threshold " . "$self->{critical_val_for}->{$var}\n"; } - if ( !$val || $val >= $self->{max_val_for}->{$var} ) { + if ( $val >= $self->{max_val_for}->{$var} ) { $vals_too_high{$var} = $val; } else { @@ -8127,6 +8167,7 @@ use constant PTDEBUG => $ENV{PTDEBUG} || 0; use List::Util qw(max); use Time::HiRes qw(time sleep); use Data::Dumper; +use VersionCompare; $Data::Dumper::Indent = 1; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Quotekeys = 0; @@ -8148,6 +8189,9 @@ my $dont_interrupt_now = 0; my @drop_trigger_sqls; my @triggers_not_dropped; my $pxc_version = '0'; + +my $triggers_info = []; + # Completely ignore these error codes. my %ignore_code = ( # Error: 1592 SQLSTATE: HY000 (ER_BINLOG_UNSAFE_STATEMENT) @@ -8253,6 +8297,18 @@ sub main { $o->set('drop-old-table', 0); } + if ( !$o->get('drop-triggers') && $o->get('preserve-triggers') ) { + my $msg = "Cannot use --no-drop-triggers along with --preserve-triggers " + . "since --preserve-triggers implies that the old triggers should be deleted" + . " and recreated in the new table.\nPlease read the documentation for " + . "--preserve-triggers"; + die $msg; + } + + if ( $o->get('preserve-triggers') ) { + $o->set('drop-triggers', 1); + } + if ( !$o->get('help') ) { if ( @ARGV ) { $o->save_error('Specify only one DSN on the command line'); @@ -8330,11 +8386,8 @@ sub main { # think that can be less confusing. Also, the $set_on_connect variable can be # inlined into this subroutine. Many of our tools have a get_dbh() subroutine # and it might be good to just make a convention of it. - # Note: args->{errok} to tolerate connection error my $make_cxn = sub { my (%args) = @_; - my $errok = $args{errok}; - delete($args{errok}); my $cxn = Cxn->new( %args, DSNParser => $dp, @@ -8343,12 +8396,7 @@ sub main { ); eval { $cxn->connect() }; # connect or die trying if ( $EVAL_ERROR ) { - if ($errok) { - printf "IGNORING CONNECTION ERROR: %s\n", - $EVAL_ERROR; - } else { - die "Cannot connect to MySQL: $EVAL_ERROR\n"; - } + die "Cannot connect to MySQL: $EVAL_ERROR\n"; } return $cxn; }; @@ -8487,26 +8535,18 @@ sub main { Quoter => $q, ); - my $get_slaves_cb = sub { - my ($intolerant) = @_; - return( $ms->get_slaves( - dbh => $cxn->dbh(), - dsn => $cxn->dsn(), - make_cxn => sub { - return $make_cxn->(@_, prev_dsn => $cxn->dsn(), - errok => (not $intolerant)); - }, - ) - ); - }; - - ### first ever call only: do not tolerate connection errors - $slaves = $get_slaves_cb->('intolerant'); + $slaves = $ms->get_slaves( + dbh => $cxn->dbh(), + dsn => $cxn->dsn(), + make_cxn => sub { + return $make_cxn->(@_, prev_dsn => $cxn->dsn()); + }, + ); PTDEBUG && _d(scalar @$slaves, 'slaves found'); if ( scalar @$slaves ) { print "Found " . scalar(@$slaves) . " slaves:\n"; foreach my $cxn ( @$slaves ) { - printf("%s -> %s:%s\n", $cxn->name(), $cxn->{dsn}->{h}, $cxn->{dsn}->{P}); + print $cxn->description()."\n"; } } elsif ( ($o->get('recursion-method') || '') ne 'none') { @@ -8525,7 +8565,6 @@ sub main { prev_dsn => $cxn->dsn(), ); $slave_lag_cxns = [ $cxn ]; - $get_slaves_cb = undef; } else { PTDEBUG && _d('Will check slave lag on all slaves'); @@ -8543,7 +8582,7 @@ sub main { } } if ($found) { - printf("Skipping slave %s -> %s:%s\n", $slave->name(), $slave->{dsn}->{h}, $slave->{dsn}->{P}); + print "Skipping slave ". $slave->description()."\n"; } else { push @$filtered_slaves, $slave; } @@ -8555,7 +8594,7 @@ sub main { } else{ print "Will check slave lag on:\n"; foreach my $cxn ( @$slave_lag_cxns ) { - printf("%s -> %s:%s\n", $cxn->name(), $cxn->{dsn}->{h}, $cxn->{dsn}->{P}); + print $cxn->description()."\n"; } } } @@ -8656,12 +8695,11 @@ sub main { } $replica_lag = new ReplicaLagWaiter( - slaves => $slave_lag_cxns, - get_slaves_cb => $get_slaves_cb, - max_lag => $o->get('max-lag'), - oktorun => sub { return $oktorun }, - get_lag => $get_lag, - sleep => $sleep, + slaves => $slave_lag_cxns, + max_lag => $o->get('max-lag'), + oktorun => sub { return $oktorun }, + get_lag => $get_lag, + sleep => $sleep, ); my $get_status; @@ -8790,6 +8828,7 @@ sub main { tbl => $orig_tbl, Cxn => $cxn, Quoter => $q, + only_same_schema_fks => $o->get('only-same-schema-fks'), ); if ( !$child_tables ) { if ( $alter_fk_method ) { @@ -8949,13 +8988,13 @@ sub main { if ( $o->get('check-alter') ) { check_alter( - tbl => $orig_tbl, - alter => $alter, - dry_run => $o->get('dry-run'), - renamed_cols => $renamed_cols, - Cxn => $cxn, - TableParser => $tp, - got_use_insert_ignore => $o->got('use-insert-ignore'), + tbl => $orig_tbl, + alter => $alter, + dry_run => $o->get('dry-run'), + renamed_cols => $renamed_cols, + Cxn => $cxn, + TableParser => $tp, + OptionParser => $o, ); } } @@ -9275,7 +9314,7 @@ sub main { . "To drop the triggers, execute:\n" . join("\n", @drop_trigger_sqls) . "\n"; } - elsif ( !$drop_triggers ) { + elsif ( !$drop_triggers ) { print "Not dropping triggers because --no-drop-triggers was " . "specified. To drop the triggers, execute:\n" . join("\n", @drop_trigger_sqls) . "\n"; @@ -9596,8 +9635,7 @@ sub main { # NibbleIterator combines these two statements and adds # "FROM $orig_table->{name} WHERE ". - my $ignore = $o->get('use-insert-ignore') ? "IGNORE" : ''; - my $dml = "INSERT LOW_PRIORITY $ignore INTO $new_tbl->{name} " + my $dml = "INSERT LOW_PRIORITY IGNORE INTO $new_tbl->{name} " . "(" . join(', ', map { $q->quote($_->{new}) } @common_cols) . ") " . "SELECT"; my $select = join(', ', map { $q->quote($_->{old}) } @common_cols); @@ -9710,6 +9748,46 @@ sub main { $plugin->before_swap_tables(); } + if ( $o->get('preserve-triggers') ) { + if ( !$o->get('swap-tables') && $o->get('drop-new-table') ) { + print ts("Skipping triggers creation since --no-swap-tables was specified along with --drop-new-table\n"); + } else { + print ts("Adding original triggers to new table.\n"); + foreach my $trigger_info (@$triggers_info) { + next if ! ($trigger_info->{orig_triggers}); + foreach my $orig_trigger (@{$trigger_info->{orig_triggers}}) { + # if --no-swap-tables is used and --drop-new-table (default), then we don't do any trigger stuff + my $new_trigger_sqls; + eval { + # if --no-swap-tables is used and --no-drop-new-table is used, then we need to duplicate the trigger + my $duplicate_trigger = ( ! $o->get('swap-tables') && ! $o->get('drop-new-table') ) ? 1 : undef; + + $new_trigger_sqls = create_trigger_sql(trigger => $orig_trigger, + db => $new_tbl->{db}, + new_tbl => $new_tbl->{tbl}, + orig_tbl => $orig_tbl->{tbl}, + duplicate_trigger => $duplicate_trigger, + ); + }; + if ($EVAL_ERROR) { + die "Cannot create triggers: $EVAL_ERROR"; + } + next if !$o->get('execute'); + PTDEBUG && _d('New triggers sqls'); + for my $sql (@$new_trigger_sqls) { + PTDEBUG && _d($sql); + eval { + $cxn->dbh()->do($sql); + }; + if ($EVAL_ERROR) { + die "Exiting due to errors while restoring triggers: $EVAL_ERROR"; + } + } + } + } + } + } + my $old_tbl; if ( $o->get('swap-tables') ) { @@ -9934,14 +10012,33 @@ sub validate_tries { sub check_alter { my (%args) = @_; - my @required_args = qw(alter tbl dry_run Cxn TableParser got_use_insert_ignore); + my @required_args = qw(alter tbl dry_run Cxn TableParser OptionParser); foreach my $arg ( @required_args ) { die "I need a $arg argument" unless exists $args{$arg}; } - my ($alter, $tbl, $dry_run, $cxn, $tp, $got_use_insert_ignore) = @args{@required_args}; + my ($alter, $tbl, $dry_run, $cxn, $tp, $o) = @args{@required_args}; my $ok = 1; + my $unique_fields = get_unique_index_fields($alter); + + if (scalar @$unique_fields && $o->get('check-unique-key-change')) { + my $msg = "You are trying to add an unique key. This can result in data loss if the " + . "data is not unique.\n" + . "Please read the documentation for the --check-unique-key-change parameter.\n" + . "You can check if the column(s) contain duplicate content " + . "by running this/these query/queries:\n\n"; + foreach my $fields (@$unique_fields) { + my $sql = "SELECT IF(COUNT(DISTINCT " . join(", ", @$fields) . ") = COUNT(*),\n" + . " 'Yes, the desired unique index currently contains only unique values', \n" + . " 'No, the desired unique index contains duplicated values. There will be data loss'\n" + . ") AS IsThereUniqueness FROM `$tbl->{db}`.`$tbl->{tbl}`;\n\n"; + $msg .= $sql; + } + $msg .= "Keep in mind that these queries could take a long time and consume a lot of resources\n\n"; + die ($msg); + } + # ######################################################################## # Check for DROP PRIMARY KEY. # ######################################################################## @@ -10009,34 +10106,55 @@ sub check_alter { } } - # This regex matches unquoted strings in $1 and quoted strings in $2 - # We need to loop through all matches in the alter string and check if the - # unquoted part has the string 'UNIQUE INDEX' - # We are doing this because the alter could be something like - # ADD KEY pk COMMENT "ADD UNIQUE KEY" - my $re = qr/([^"']*)?((?:"|\\"|'|\\').*?(?:"|\\"|'|\\'))?/i; - my $has_unique_index = 0; - while ( $alter =~ m/$re/g) { - if ($1 =~ m/UNIQUE INDEX/i) { - $has_unique_index = 1; - } - } - if ($has_unique_index && !$got_use_insert_ignore) { - $ok = 0; - warn "It seems like you are trying to add an UNIQUE INDEX.\n" - . "Since in some cases this could lead to data loss, you need to specify a value " - . "for the use-insert-ignore parameter.\n" - . "Please read the documentation and restart the program with the apropriate paramenters.\n"; - } - if ( !$ok ) { # check_alter.t relies on this output. die "--check-alter failed.\n"; } - + return; } +# This function tries to detect if the --alter param is adding unique indexes. +# It returns an array of arrays, having a list of fields for each unique index +# found. +# Example: +# Input string: add i int comment "first comment ", ADD UNIQUE INDEX (C1) comment +# 'second comment', CREATE UNIQUE INDEX C ON T1 (C2, c3) comment "third" +# +# Output: +# $VAR1 = [ +# [ 'C1' ], +# [ 'C2', 'c3' ] +# ]; +# +# Thse fields are used to build an example SELECT to detect if currently there are +# rows that will produce duplicates when the new UNIQUE INDEX is created. + +sub get_unique_index_fields { + my ($alter) = @_; + my $remove_comments_re = qr/(.*?\s+)?comment ('.*?'|".*?")(.*)/i; + + $alter =~ s/\\"//g; # Remove \" just to make remove_comments_re easier + + my $clean; + my $suffix = $alter; + + while ($alter =~ /$remove_comments_re/g) { + $clean .= $1; + $suffix = $3; + } + $clean .= $suffix; + + my $fields = []; + my $fields_re = qr/\s(?:PRIMARY|UNIQUE)\s+(?:INDEX|KEY|)\s*(?:.*?)\s*\((.*?)\)/i; + + while($clean =~ /$fields_re/g) { + push @$fields, [ split /\s*,\s*/, $1 ]; + } + + return $fields; +} + sub find_renamed_cols { my (%args) = @_; my @required_args = qw(alter TableParser); @@ -10089,7 +10207,7 @@ sub find_renamed_cols { my (undef, $new_tbl) = Quoter->split_unquote($new); # Silly but plausible: CHANGE COLUMN same_name same_name ... next if lc($orig_tbl) eq lc($new_tbl); - $renames{$orig_tbl} = $new_tbl; + $renames{lc($orig_tbl)} = $new_tbl; } PTDEBUG && _d("Renamed columns (old => new): ", Dumper(\%renames)); return \%renames; @@ -10235,6 +10353,8 @@ sub create_new_table { ); my $constraint_pattern = qr((CONSTRAINT `__|CONSTRAINT `_|CONSTRAINT `)); $sql =~ s/$constraint_pattern/$search_dict{$1}/gm; + # Limit constraint name to 64 characters + $sql =~ s/CONSTRAINT `([^`]{1,64})[^`]*` (.*)/ CONSTRAINT `$1` $2/gm; if ( $o->get('default-engine') ) { $sql =~ s/\s+ENGINE=\S+//; @@ -10417,15 +10537,22 @@ sub check_orig_table { die "The original table $orig_tbl->{name} does not exist.\n"; } + my ( $version ) = $dbh->selectrow_array("SELECT VERSION()"); # There cannot be any triggers on the original table. my $sql = 'SHOW TRIGGERS FROM ' . $q->quote($orig_tbl->{db}) . ' LIKE ' . $q->literal_like($orig_tbl->{tbl}); PTDEBUG && _d($sql); my $triggers = $dbh->selectall_arrayref($sql); if ( $triggers && @$triggers ) { - die "The table $orig_tbl->{name} has triggers. This tool " - . "needs to create its own triggers, so the table cannot " - . "already have triggers.\n"; + if ( VersionCompare::cmp($version, '5.7.0') < 0 && VersionCompare::cmp($version, '10.0.0') <= 0) { + die "The table $orig_tbl->{name} has triggers. This tool " + . "needs to create its own triggers, so the table cannot " + . "already have triggers.\n"; + } elsif ( ( VersionCompare::cmp($version, '5.7.0') >= 0 || VersionCompare::cmp($version, '10.0.0') >0 ) + && !$o->get('preserve-triggers') ) { + die "The table $orig_tbl->{name} has triggers but --preserve-triggers was not specified.\n" + . "Please read the documentation for --preserve-triggers.\n"; + } } # Get the table struct. NibbleIterator needs this, and so do we. @@ -10473,6 +10600,11 @@ sub find_child_tables { . "FROM information_schema.key_column_usage " . "WHERE referenced_table_schema='$tbl->{db}' " . "AND referenced_table_name='$tbl->{tbl}'"; + + if ($args{only_same_schema_fks}) { + $sql .= " AND table_schema='$tbl->{db}'"; + } + PTDEBUG && _d($sql); my $rows = $cxn->dbh()->selectall_arrayref($sql); if ( !$rows || !@$rows ) { @@ -10769,6 +10901,8 @@ sub create_triggers { # they may have been renamed my %old_col_for = map { $_->{new} => $_->{old} } @$cols; my $tbl_struct = $del_tbl->{tbl_struct}; + + # --------------------------------------------------------------------------------------- my $del_index = $del_tbl->{del_index}; my $del_index_cols = join(" AND ", map { my $new_col = $_; @@ -10784,21 +10918,25 @@ sub create_triggers { . "DELETE IGNORE FROM $new_tbl->{name} " . "WHERE $del_index_cols"; + # --------------------------------------------------------------------------------------- my $qcols = join(', ', map { $q->quote($_->{new}) } @$cols); my $new_vals = join(', ', map { "NEW.".$q->quote($_->{old}) } @$cols); + my $insert_trigger = "CREATE TRIGGER `${prefix}_ins` AFTER INSERT ON $orig_tbl->{name} " . "FOR EACH ROW " . "REPLACE INTO $new_tbl->{name} ($qcols) VALUES ($new_vals)"; + # --------------------------------------------------------------------------------------- my $upd_index_cols = join(" AND ", map { - my $new_col = $_; - my $old_col = $old_col_for{$new_col} || $new_col; - my $new_qcol = $q->quote($new_col); - my $old_qcol = $q->quote($old_col); - "OLD.$old_qcol <=> NEW.$new_qcol" + my $new_col = $_; + my $old_col = $old_col_for{$new_col} || $new_col; + my $new_qcol = $q->quote($new_col); + my $old_qcol = $q->quote($old_col); + "OLD.$old_qcol <=> NEW.$new_qcol" } @{$tbl_struct->{keys}->{$del_index}->{cols}} ); - + # --------------------------------------------------------------------------------------- + my $update_trigger = "CREATE TRIGGER `${prefix}_upd` AFTER UPDATE ON $orig_tbl->{name} " . "FOR EACH ROW " @@ -10807,36 +10945,110 @@ sub create_triggers { . "REPLACE INTO $new_tbl->{name} ($qcols) VALUES ($new_vals);" . "END "; - my @triggers = ( - ['del', $delete_trigger], - ['upd', $update_trigger], - ['ins', $insert_trigger], - ); + $triggers_info = [ + { + suffix => 'del', event => 'DELETE', time => 'AFTER', orig_triggers => [], + new_trigger_sql => $delete_trigger, new_trigger_name => "${prefix}_del", + }, + { + suffix => 'upd', event => 'UPDATE', time => 'AFTER', orig_triggers => [], + new_trigger_sql => $update_trigger, new_trigger_name => "${prefix}_upd", + }, + { + suffix => 'ins', event => 'INSERT', time => 'AFTER', orig_triggers => [], + new_trigger_sql => $insert_trigger, new_trigger_name => "${prefix}_ins", + }, + + { + suffix => 'delb', event => 'DELETE', time => 'BEFORE', orig_triggers => [], + new_trigger_sql => '', new_trigger_name => '' + }, + { + suffix => 'updb', event => 'UPDATE', time => 'BEFORE', orig_triggers => [], + new_trigger_sql => '', new_trigger_name => '' + }, + { + suffix => 'insb', event => 'INSERT', time => 'BEFORE', orig_triggers => [], + new_trigger_sql => '', new_trigger_name => '' + }, + ]; + + $cxn->connect(); + my $dbh = $cxn->dbh(); + + my $trigger_sql = "SELECT TRIGGER_SCHEMA, TRIGGER_NAME, DEFINER, ACTION_STATEMENT, SQL_MODE, " + . " CHARACTER_SET_CLIENT, COLLATION_CONNECTION, EVENT_MANIPULATION, ACTION_TIMING " + . " FROM INFORMATION_SCHEMA.TRIGGERS " + . " WHERE EVENT_MANIPULATION = ? " + . " AND ACTION_TIMING = ? " + . " AND TRIGGER_SCHEMA = ? " + . " AND EVENT_OBJECT_TABLE = ?"; + foreach my $trigger_info (@$triggers_info) { + $trigger_info->{orig_triggers} = $dbh->selectall_arrayref( $trigger_sql, + { Slice => {} }, + $trigger_info->{event}, + $trigger_info->{time}, + $orig_tbl->{db}, + $orig_tbl->{tbl} + ) || []; + } + + # If --preserve-triggers was specified, try to create the original triggers into the new table. + # We are doing this to ensure the original triggers will work in the new modified table + # and we want to know this BEFORE copying all rows from the old table to the new one. + if ($o->get('preserve-triggers')) { + foreach my $trigger_info (@$triggers_info) { + foreach my $orig_trigger (@{$trigger_info->{orig_triggers}}) { + my $definer = $orig_trigger->{definer} || ''; + $definer =~ s/@/`@`/; + $definer = "`$definer`" ; + + my @chars = ("a".."z"); + my $tmp_trigger_name; + $tmp_trigger_name .= $chars[rand @chars] for 1..15; + + my $sql = "CREATE DEFINER=$definer " + . "TRIGGER `$new_tbl->{db}`.`$tmp_trigger_name` " + . "$orig_trigger->{action_timing} $orig_trigger->{event_manipulation} ON $new_tbl->{tbl}\n" + . "FOR EACH ROW\n" + . $orig_trigger->{action_statement}; + eval { + $dbh->do($sql); + }; + if ($EVAL_ERROR) { + my $msg = "$EVAL_ERROR.\n" + . "Check if all fields referenced by the trigger still exists " + . "after the operation you are trying to apply"; + die ($msg); + } + $dbh->do("DROP TRIGGER IF EXISTS `$tmp_trigger_name`"); + } + } + } my @trigger_names; @drop_trigger_sqls = (); - foreach my $trg ( @triggers ) { - my ($name, $sql) = @$trg; - print $sql, "\n" if $o->get('print'); - if ( $o->get('execute') ) { - osc_retry( - Cxn => $cxn, - Retry => $retry, - tries => $tries->{create_triggers}, - stats => $stats, - code => sub { - PTDEBUG && _d($sql); - $cxn->dbh()->do($sql); - }, - ); - } - # Only save the trigger once it has been created - # (or faked to be created) so if the 2nd trigger - # fails to create, we know to only drop the 1st. - push @trigger_names, "${prefix}_$name"; - push @drop_trigger_sqls, - "DROP TRIGGER IF EXISTS " - . $q->quote($orig_tbl->{db}, "${prefix}_$name") . ";"; + + foreach my $trigger_info ( @$triggers_info ) { + next if !$trigger_info->{new_trigger_sql}; + if ( $o->get('execute') ) { + osc_retry( + Cxn => $cxn, + Retry => $retry, + tries => $tries->{create_triggers}, + stats => $stats, + code => sub { + PTDEBUG && _d($trigger_info->{new_trigger_sql}); + $cxn->dbh()->do($trigger_info->{new_trigger_sql}); + }, + ); + } + # Only save the trigger once it has been created + # (or faked to be created) so if the 2nd trigger + # fails to create, we know to only drop the 1st. + push @trigger_names, $trigger_info->{new_trigger_name}; + push @drop_trigger_sqls, + "DROP TRIGGER IF EXISTS " . $q->quote($orig_tbl->{db}, $trigger_info->{new_trigger_name}); } if ( $o->get('execute') ) { @@ -10846,6 +11058,82 @@ sub create_triggers { return @trigger_names; } +sub random_suffix { + my @chars = ("a".."z"); + my $suffix; + $suffix .= $chars[rand @chars] for 1..15; + return "_$suffix"; +} + +# Create the sql staments for the new trigger +# Required args: +# trigger : Hash with trigger definition +# db : Database handle +# new_table : New table name +# +# Optional args: +# orig_table.......: Original table name. Used to LOCK the table. +# In case we are creating a new temporary trigger for testing +# purposes or if --no-swap-tables is enabled, this param should +# be omitted since we are creating a completelly new trigger so, +# since in this case we are not going to DROP the old trigger, +# there is no need for a LOCK +# +# duplicate_trigger: If set, it will create the trigger on the new table +# with a random string as a trigger name suffix. +# It will also not drop the original trigger. +# This is usefull when creating a temporary trigger for testing +# purposes or if --no-swap-tables AND --no-drop-new-table was +# specified along with --preserve-triggers. In this case, +# since the original table and triggers are not going to be +# deleted we need a new random name because trigger names +# cannot be duplicated +sub create_trigger_sql { + my (%args) = @_; + my @required_args = qw(trigger db new_tbl); + foreach my $arg ( @required_args ) { + die "I need a $arg argument" unless $args{$arg}; + } + + my $trigger = $args{trigger}; + my $suffix = $args{duplicate_trigger} ? random_suffix() : ''; + if (length("$trigger->{trigger_name}$suffix") > 64) { + die "New trigger name $trigger->{trigger_name}$suffix is too long"; + } + + my $definer = $args{trigger}->{definer} | ''; + $definer =~ s/@/`@`/; + $definer = "`$definer`" ; + + my $sqls = []; + push @$sqls, "LOCK TABLES `$args{db}`.`$args{new_tbl}` WRITE, `$args{db}`. `$args{orig_tbl}` WRITE;"; + push @$sqls, '/*!50003 SET @saved_sql_mode = @@sql_mode */'; + push @$sqls, '/*!50003 SET @saved_cs_client = @@character_set_client */ ;'; + push @$sqls, '/*!50003 SET @saved_cs_results = @@character_set_results */ ;'; + push @$sqls, '/*!50003 SET @saved_col_connection = @@collation_connection */ ;'; + + push @$sqls, "/*!50003 SET character_set_client = $trigger->{character_set_client} */ ;"; + push @$sqls, "/*!50003 SET collation_connection = $trigger->{collation_connection} */ ;"; + push @$sqls, "SET SESSION sql_mode = '$trigger->{sql_mode}'"; + + push @$sqls, "DROP TRIGGER IF EXISTS `$args{db}`.`$trigger->{trigger_name}` " if ! $args{duplicate_trigger}; + + push @$sqls, "CREATE DEFINER=$definer " + . "TRIGGER `$args{db}`.`$trigger->{trigger_name}$suffix` " + . "$trigger->{action_timing} $trigger->{event_manipulation} ON $args{new_tbl}\n" + . "FOR EACH ROW\n" + . $trigger->{action_statement}; + + push @$sqls, '/*!50003 SET sql_mode = @saved_sql_mode */ ;'; + push @$sqls, '/*!50003 SET character_set_client = @saved_cs_client */ ;'; + push @$sqls, '/*!50003 SET character_set_results = @saved_cs_results */'; + push @$sqls, '/*!50003 SET collation_connection = @saved_col_connection */ ;'; + push @$sqls, 'UNLOCK TABLES'; + + return $sqls; + +} + sub drop_triggers { my ( %args ) = @_; my @required_args = qw(tbl Cxn Quoter OptionParser Retry tries stats); @@ -11008,7 +11296,6 @@ sub exec_nibble { # any pattern # use MySQL's message for this warning }, - 1062 => {}, ); return osc_retry( @@ -11126,6 +11413,40 @@ sub ts { return $msg ? "$ts $msg" : $ts; } +# find point in trigger we can insert pt-osc code for --preserve-triggers +sub trigger_ins_point { + my ( %args ) = @_; + my @required_args = qw(trigger); + foreach my $arg ( @required_args ) { + die "I need a $arg argument" unless defined $args{$arg}; + } + my ($trigger) = @args{@required_args}; + + my $ins_point; + if ($trigger =~ /begin(.*?)end(?!.*end)/igms) { + $ins_point = $+[0] - 3; + } + else { $ins_point = 0;} + + return $ins_point; +} + +# sub to add ; if line doesn't end in ; +sub terminate_sql { + my ( $text ) = @_; + die "I need a text argument" unless defined $text; + $text = trim($text); + if(substr($text, -1) ne ';') { $text .= ';'; } + return $text; +} + +sub trim { + my ( $text ) = @_; + die "I need a text argument" unless defined $text; + $text =~ s/^\s+|\s+$//g; + return $text; +} + # Catches signals so we can exit gracefully. sub sig_int { my ( $signal ) = @_; @@ -11296,6 +11617,11 @@ The tool exits with an error if the host is a cluster node and the table is MyISAM or is being converted to MyISAM (C), or if C is not C. There is no way to disable these checks. +=head1 MySQL 5.7+ Generated columns + +The tools ignores MySQL 5.7+ C columns since the value for those columns +is generated according to the expresion used to compute column values. + =head1 OUTPUT The tool prints information about its activities to STDOUT so that you can see @@ -11784,28 +12110,46 @@ only perform some safety checks and exit. This helps ensure that you have read documentation and understand how to use this tool. If you have not read the documentation, then do not specify this option. -=item --force - -This options bypasses confirmation in case of using alter-foreign-keys-method = none , which might break foreign key constraints. - -=item --[no]use-insert-ignore +=item --[no]check-unique-key-change default: yes -pt-online-schema-change by default use INSERT LOW_PRIORITY IGNORE statements to copy rows from the old table to the new one. -In some cases, like when altering a table to add an unique index, using IGNORE may lead to data loss. +Avoid C to run if the specified statement for L<"--alter"> is +trying to add an unique index. +Since C uses C to copy rows to the new table, if +the row being written produces a duplicate key, it will fail silently and data will +be lost. + Example: -CREATE TABLE test.t1 ( - id TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - notunique VARCHAR(200) NOT NULL -); + CREATE DATABASE test; + USE test; + CREATE TABLE `a` ( + `id` int(11) NOT NULL, + `unique_id` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + insert into a values (1, "a"); + insert into a values (2, "b"); + insert into a values (3, ""); + insert into a values (4, ""); + insert into a values (5, NULL); + insert into a values (6, NULL); -INSERT INTO test.t1(notunique) VALUES('test01'),('test01'),('test02'); +Using C to add an unique index on the C field, will cause some rows to +be lost due to the use of C to copy rows from the source table. +For this reason, C will fail if it detects that the L<"--alter"> parameter is trying +to add an unique key and it will show an example query to run to detect if there are +rows that will produce duplicated indexes. -If you run pt-online-schema-change --alter="ADD UNIQUE INDEX unique_1 (notunique)", when copying the second row to the new -table, INSERT ... IGNORE will fail silently and that row won't be copied. -In cas osc detects you are adding an UNIQUE index, you need to specify this option in the command line. +Even if you run the query and there are no rows that will produce duplicated indexes, +take into consideration that after running this query, changes can be made to the table that can produce +duplicate rows and this data will be lost. + +=item --force + +This options bypasses confirmation in case of using alter-foreign-keys-method = none , which might break foreign key constraints. =item --help @@ -11877,6 +12221,59 @@ until queries are running normally again. This will not prevent queueing, however; it will only give the server a chance to recover from the queueing. If you notice queueing, it is best to decrease the chunk time. +=item --preserve-triggers + +Preserves old triggers when specified. +As of MySQL 5.7.2, it is possible to define multiple triggers for a given +table that have the same trigger event and action time. This allows us to +add the triggers needed for C even if the table +already has its own triggers. +If this option is enabled, C will try to copy all the +existing triggers to the new table BEFORE start copying rows from the original +table to ensure the old triggers can be applied after altering the table. + +Example. + + CREATE TABLE test.t1 ( + id INT NOT NULL AUTO_INCREMENT, + f1 INT, + f2 VARCHAR(32), + PRIMARY KEY (id) + ); + + CREATE TABLE test.log ( + ts TIMESTAMP, + msg VARCHAR(255) + ); + + CREATE TRIGGER test.after_update + AFTER + UPDATE ON test.t1 + FOR EACH ROW + INSERT INTO test.log VALUES (NOW(), CONCAT("updated row row with id ", OLD.id, " old f1:", OLD.f1, " new f1: ", NEW.f1 )); + +For this table and triggers combination, it is not possible to use L<--preserve-triggers> +with an L<--alter> like this: C<"DROP COLUMN f1"> since the trigger references the column +being dropped and at would make the trigger to fail. + +After testing the triggers will work on the new table, the triggers are +dropped from the new table until all rows have been copied and then they are +re-applied. + +L<--preserve-triggers> cannot be used with these other parameters, L<--no-drop-triggers>, +L<--no-drop-old-table> and L<--no-swap-tables> since L<--preserve-triggers> implies that +the old triggers should be deleted and recreated in the new table. +Since it is not possible to have more than one trigger with the same name, old triggers +must be deleted in order to be able to recreate them into the new table. + +Using C<--preserve-triggers> with C<--no-swap-tables> will cause triggers to remain +defined for the original table. +Please read the documentation for L<--swap-tables> + +If both C<--no-swap-tables> and C<--no-drop-new-table> is set, the trigger will remain +on the original table and will be duplicated on the new table +(the trigger will have a random suffix as no trigger names are unique). + =item --new-table-name type: string; default: %T_new @@ -11894,6 +12291,13 @@ them. The rows which contain NULL values will be converted to the defined default value. If no explicit DEFAULT value is given MySQL will assign a default value based on datatype, e.g. 0 for number datatypes, '' for string datatypes. +=item --only-same-schema-fks + +Check foreigns keys only on tables on the same schema than the original table. +This option is dangerous since if you have FKs refenrencing tables in other +schemas, they won't be detected. + + =item --password short form: -p; type: string @@ -12010,7 +12414,9 @@ if you change the contents of the DSN table, OSC will pick it up very soon. type: DSN; repeatable: yes DSN to skip when checking slave lag. It can be used multiple times. -Example: --skip-check-slave-lag h=127.1,P=12345 --skip-check-slave-lag h=127.1,P=12346 +Example: --skip-check-slave-lag h=127.0.0.1,P=12345 --skip-check-slave-lag h=127.0.0.1,P=12346 +Plase take into consideration that even when for the MySQL driver h=127.1 is equal to h=127.0.0.1, +for this parameter you need to specify the full IP address. =item --slave-user @@ -12087,6 +12493,10 @@ online schema change process by making the table with the new schema take the place of the original table. The original table becomes the "old table," and the tool drops it unless you disable L<"--[no]drop-old-table">. +Using C<--no-swap-tables> will run the whole process, it will create the new +table, it will copy all rows but at the end it will drop the new table. It is +intended to run a more realistic L<--dry-run>. + =item --tries type: array @@ -12536,6 +12946,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-online-schema-change 3.0.2 +pt-online-schema-change 3.0.4 =cut diff --git a/bin/pt-pmp b/bin/pt-pmp index e8b2c3ec..dbf8774c 100755 --- a/bin/pt-pmp +++ b/bin/pt-pmp @@ -897,7 +897,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-pmp 3.0.2 +pt-pmp 3.0.4 =cut diff --git a/bin/pt-query-digest b/bin/pt-query-digest index e34f5cd3..c941ddc3 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -64,7 +64,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -3251,6 +3251,17 @@ sub new { foreach my $arg ( qw(MasterSlave) ) { die "I need a $arg argument" unless $args{$arg}; } + my $kill_busy_commands = {}; + if ($args{kill_busy_commands}) { + for my $command (split /,/,$args{kill_busy_commands}) { + $command =~ s/^\s+|\s+$//g; + $kill_busy_commands->{$command} = 1; + } + } else { + $kill_busy_commands->{Query} = 1; + } + $args{kill_busy_commands} = $kill_busy_commands; + my $self = { %args, polls => 0, @@ -3465,6 +3476,7 @@ sub find { my $ms = $self->{MasterSlave}; my @matches; + $self->{_reasons_for_matching} = undef; QUERY: foreach my $query ( @$proclist ) { PTDEBUG && _d('Checking query', Dumper($query)); @@ -3476,7 +3488,7 @@ sub find { next QUERY; } - if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + if ( $find_spec{busy_time} && exists($self->{kill_busy_commands}->{$query->{Command} || ''}) ) { next QUERY unless defined($query->{Time}); if ( $query->{Time} < $find_spec{busy_time} ) { PTDEBUG && _d("Query isn't running long enough"); @@ -8834,7 +8846,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -8845,8 +8857,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -8863,6 +8875,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -8871,24 +8888,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -8965,6 +8992,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -8972,8 +9001,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -16772,6 +16802,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-query-digest 3.0.2 +pt-query-digest 3.0.4 =cut diff --git a/bin/pt-show-grants b/bin/pt-show-grants index e1b57e34..075454bf 100755 --- a/bin/pt-show-grants +++ b/bin/pt-show-grants @@ -2524,6 +2524,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-show-grants 3.0.2 +pt-show-grants 3.0.4 =cut diff --git a/bin/pt-sift b/bin/pt-sift index 60c7e915..39f8f846 100755 --- a/bin/pt-sift +++ b/bin/pt-sift @@ -1245,7 +1245,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-sift 3.0.2 +pt-sift 3.0.4 =cut diff --git a/bin/pt-slave-delay b/bin/pt-slave-delay index 56032d14..d274f68b 100755 --- a/bin/pt-slave-delay +++ b/bin/pt-slave-delay @@ -40,7 +40,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -4919,6 +4919,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-slave-delay 3.0.2 +pt-slave-delay 3.0.4 =cut diff --git a/bin/pt-slave-find b/bin/pt-slave-find index a7b4b153..8d6c7094 100755 --- a/bin/pt-slave-find +++ b/bin/pt-slave-find @@ -4465,6 +4465,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-slave-find 3.0.2 +pt-slave-find 3.0.4 =cut diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 0657292f..e6f1337f 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -41,7 +41,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -6054,6 +6054,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-slave-restart 3.0.2 +pt-slave-restart 3.0.4 =cut diff --git a/bin/pt-stalk b/bin/pt-stalk index a7670940..802f8832 100755 --- a/bin/pt-stalk +++ b/bin/pt-stalk @@ -832,9 +832,7 @@ collect() { $CMD_MYSQLADMIN $EXT_ARGV debug else log "Could not find the MySQL error log" - fi - - + fi if [ "${mysql_version}" '>' "5.1" ]; then local mutex="SHOW ENGINE INNODB MUTEX" else @@ -960,6 +958,10 @@ collect() { ps_locks_transactions "$d/$p-ps-locks-transactions" fi + if [ "${mysql_version}" '>' "5.6" ]; then + (echo $ts; ps_prepared_statements) >> "$d/$p-prepared-statements" & + fi + slave_status "$d/$p-slave-status" "${mysql_version}" curr_time=$(date +'%s') @@ -1126,6 +1128,13 @@ ps_locks_transactions() { } +ps_prepared_statements() { + $CMD_MYSQL $EXT_ARGV -e "SELECT t.processlist_id, pse.* \ + FROM performance_schema.prepared_statements_instances pse \ + JOIN performance_schema.threads t \ + ON (pse.OWNER_THREAD_ID=t.thread_id)\G" +} + slave_status() { local outfile=$1 local mysql_version=$2 @@ -2337,7 +2346,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-stalk 3.0.2 +pt-stalk 3.0.4 =cut diff --git a/bin/pt-summary b/bin/pt-summary index 66a7889d..e080d88e 100755 --- a/bin/pt-summary +++ b/bin/pt-summary @@ -2257,10 +2257,11 @@ report_system_summary () { local PTFUNCNAME=report_system_summary; report_transparent_huge_pages () { + STATUS_THP_SYSTEM="" if [ -f /sys/kernel/mm/transparent_hugepage/enabled ]; then CONTENT_TRANSHP=$( 'all'; @@ -3680,6 +3680,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -3711,9 +3716,20 @@ sub is_cluster_node { my ($self, $cxn) = @_; $cxn ||= $self; + my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; - PTDEBUG && _d($cxn->name, $sql); - my $row = $cxn->dbh->selectrow_arrayref($sql); + + my $dbh; + if ($cxn->isa('DBI::db')) { + $dbh = $cxn; + PTDEBUG && _d($sql); #don't invoke name() if it's not a Cxn! + } + else { + $dbh = $cxn->dbh(); + PTDEBUG && _d($cxn->name, $sql); + } + + my $row = $dbh->selectrow_arrayref($sql); return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; } @@ -4419,7 +4435,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -4430,8 +4446,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -4448,6 +4464,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -4456,24 +4477,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -5851,17 +5882,29 @@ sub make_row_checksum { $sep =~ s/'//g; $sep ||= '#'; + my @converted_cols; + for my $col(@{$cols->{select}}) { + my $colname = $col; + $colname =~ s/`//g; + my $type = $tbl_struct->{type_for}->{$colname} || ''; + if ($type =~ m/^(CHAR|VARCHAR|BINARY|VARBINARY|BLOB|TEXT|ENUM|SET|JSON)$/i) { + push @converted_cols, "convert($col using utf8mb4)"; + } else { + push @converted_cols, "$col"; + } + } + my @nulls = grep { $cols->{allowed}->{$_} } @{$tbl_struct->{null_cols}}; if ( @nulls ) { my $bitmap = "CONCAT(" . join(', ', map { 'ISNULL(' . $q->quote($_) . ')' } @nulls) . ")"; - push @{$cols->{select}}, $bitmap; + push @converted_cols, $bitmap; } - $query .= @{$cols->{select}} > 1 - ? "$func(CONCAT_WS('$sep', " . join(', ', @{$cols->{select}}) . '))' - : "$func($cols->{select}->[0])"; + $query .= scalar @converted_cols > 1 + ? "$func(CONCAT_WS('$sep', " . join(', ', @converted_cols) . '))' + : "$func($converted_cols[0])"; } else { my $fnv_func = uc $func; @@ -7706,22 +7749,15 @@ sub table_is_allowed { return 0 if $db eq 'mysql' && $tbl =~ m/^(?: general_log - |gtid_execution + |gtid_executed |innodb_index_stats |innodb_table_stats - |inventory - |plugin - |proc |slave_master_info |slave_relay_log_info |slave_worker_info |slow_log )$/x; - return 0 if $db eq 'sys' && $tbl =~ m/^(?: - sys_config - )$/x; - if ( $filter->{'ignore-tables'}->{'*'}->{$tbl} || $filter->{'ignore-tables'}->{$db}->{$tbl}) { PTDEBUG && _d('Table', $tbl, 'is in --ignore-tables list'); @@ -8682,7 +8718,7 @@ sub wait { die "$var=$val exceeds its critical threshold " . "$self->{critical_val_for}->{$var}\n"; } - if ( !$val || $val >= $self->{max_val_for}->{$var} ) { + if ( $val >= $self->{max_val_for}->{$var} ) { $vals_too_high{$var} = $val; } else { @@ -9268,7 +9304,16 @@ sub main { } $o->usage_or_errors(); - + + + if ( $o->get('truncate-replicate-table') && $o->get('resume') ) { + die "--resume and truncate-replicate-table are mutually exclusive"; + } + + if ( $o->get('truncate-replicate-table') && !$o->get('empty-replicate-table') ) { + die "--resume and --no-empty-replicate-table are mutually exclusive"; + } + # ######################################################################## # If --pid, check it first since we'll die if it already exists. # ######################################################################## @@ -9496,6 +9541,15 @@ sub main { my $update_sth; # update master_cnt and master_cnt in repl table my $delete_sth; # delete checksums for one db.tbl from repl table + if ( $o->get('truncate-replicate-table') ) { + eval { + $master_dbh->do("TRUNCATE TABLE $repl_table"); + }; + if ($EVAL_ERROR) { + PTDEBUG && _d( "Cannot truncate replicate table $repl_table. $EVAL_ERROR"); + } + } + if ( !$o->get('explain') ) { # ##################################################################### # Find and connect to slaves. @@ -9713,12 +9767,20 @@ sub main { for my $slave (@$slave_lag_cxns) { my $found=0; for my $slave_to_skip (@$slaves_to_skip) { - if ($slave->{dsn}->{h} eq $slave_to_skip->{h} && $slave->{dsn}->{P} eq $slave_to_skip->{P}) { + my $h_eq_h = $slave->{dsn}->{h} eq $slave_to_skip->{h}; + my $p_eq_p; + if (defined($slave->{dsn}->{P}) || defined($slave_to_skip->{P})) { + $p_eq_p = $slave->{dsn}->{P} eq $slave_to_skip->{P}; + } else { + PTDEBUG && _d("Both port DSNs are undefined, setting p_eq_p to true"); + $p_eq_p = 1; + } + if ($h_eq_h && $p_eq_p) { $found=1; } } if ($found) { - printf("Skipping slave %s -> %s:%s\n", $slave->name(), $slave->{dsn}->{h}, $slave->{dsn}->{P}); + printf("Skipping slave %s\n", $slave->name()); } else { push @$filtered_slaves, $slave; } @@ -11817,6 +11879,15 @@ can try something like the following: SET boundaries = COALESCE(CONCAT('id BETWEEN ', lower_boundary, ' AND ', upper_boundary), '1=1'); +Take into consideration that by default, pt-table-checksum use C checksums. +C is not a cryptographic algorithm and for that reason it is prone to have +collisions. On the other hand, C algorithm is faster and less CPU-intensive +than C and C. + +Related reading material: +Percona Toolkit UDFs: L +How to avoid hash collisions when using MySQL’s CRC32 function: L + =head1 LIMITATIONS =over @@ -12822,6 +12893,15 @@ MySQL versions that vary in their handling of trailing spaces. MySQL 5.0 and later all retain trailing spaces in VARCHAR, while previous versions would remove them. These differences will cause false checksum differences. +=item --truncate-replicate-table + +Truncate the replicate table before starting the checksum. +This parameter differs from L<--empty-replicate-table> which only deletes the rows +for the table being checksumed when starting the checksum for that table, while +L<--truncate-replicate-table> will truncate the replicate table at the beginning of the +process and thus, all previous checksum information will be losti, even if the process +stops due to an error. + =item --user short form: -u; type: string; group: Connection @@ -13131,6 +13211,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-table-checksum 3.0.2 +pt-table-checksum 3.0.4 =cut diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 0d24f467..1dbf9d7b 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -55,7 +55,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -2853,7 +2853,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -2864,8 +2864,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -2882,6 +2882,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -2890,24 +2895,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -2984,6 +2999,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -2991,8 +3008,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -7934,22 +7952,15 @@ sub table_is_allowed { return 0 if $db eq 'mysql' && $tbl =~ m/^(?: general_log - |gtid_execution + |gtid_executed |innodb_index_stats |innodb_table_stats - |inventory - |plugin - |proc |slave_master_info |slave_relay_log_info |slave_worker_info |slow_log )$/x; - return 0 if $db eq 'sys' && $tbl =~ m/^(?: - sys_config - )$/x; - if ( $filter->{'ignore-tables'}->{'*'}->{$tbl} || $filter->{'ignore-tables'}->{$db}->{$tbl}) { PTDEBUG && _d('Table', $tbl, 'is in --ignore-tables list'); @@ -12337,7 +12348,7 @@ The default is C. Other good choices include C and C. If you have installed the C user-defined function, C will detect it and prefer to use it, because it is much faster than the built-ins. You can also use MURMUR_HASH if you've installed that user-defined function. Both of -these are distributed with Maatkit. See L for more +these are distributed with Percona Server. See L for more information and benchmarks. =item --help @@ -12955,6 +12966,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-table-sync 3.0.2 +pt-table-sync 3.0.4 =cut diff --git a/bin/pt-table-usage b/bin/pt-table-usage index 77b809a1..829d0912 100755 --- a/bin/pt-table-usage +++ b/bin/pt-table-usage @@ -6784,7 +6784,7 @@ sub parse { my ($name) = $ddl =~ m/CREATE (?:TEMPORARY )?TABLE\s+(`.+?`)/; (undef, $name) = $self->{Quoter}->split_unquote($name) if $name; - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -6795,8 +6795,8 @@ sub parse { my %def_for; @def_for{@cols} = @defs; - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -6813,6 +6813,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -6821,24 +6826,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + sub sort_indexes { my ( $self, $tbl ) = @_; @@ -6915,6 +6930,8 @@ sub check_table { my $db_tbl = $q->quote($db, $tbl); PTDEBUG && _d('Checking', $db_tbl); + $self->{check_table_error} = undef; + my $sql = "SHOW TABLES FROM " . $q->quote($db) . ' LIKE ' . $q->literal_like($tbl); PTDEBUG && _d($sql); @@ -6922,8 +6939,9 @@ sub check_table { eval { $row = $dbh->selectrow_arrayref($sql); }; - if ( $EVAL_ERROR ) { - PTDEBUG && _d($EVAL_ERROR); + if ( my $e = $EVAL_ERROR ) { + PTDEBUG && _d($e); + $self->{check_table_error} = $e; return 0; } if ( !$row->[0] || $row->[0] ne $tbl ) { @@ -8469,6 +8487,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-table-usage 3.0.2 +pt-table-usage 3.0.4 =cut diff --git a/bin/pt-upgrade b/bin/pt-upgrade index 7abcb191..11eed616 100755 --- a/bin/pt-upgrade +++ b/bin/pt-upgrade @@ -61,7 +61,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -2579,7 +2579,8 @@ sub lost_connection { my ($self, $e) = @_; return 0 unless $e; return $e =~ m/MySQL server has gone away/ - || $e =~ m/Lost connection to MySQL server/; + || $e =~ m/Lost connection to MySQL server/ + || $e =~ m/Server shutdown in progress/; } sub dbh { @@ -2598,6 +2599,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + sub get_id { my ($self, $cxn) = @_; @@ -2629,9 +2635,20 @@ sub is_cluster_node { my ($self, $cxn) = @_; $cxn ||= $self; + my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; - PTDEBUG && _d($cxn->name, $sql); - my $row = $cxn->dbh->selectrow_arrayref($sql); + + my $dbh; + if ($cxn->isa('DBI::db')) { + $dbh = $cxn; + PTDEBUG && _d($sql); #don't invoke name() if it's not a Cxn! + } + else { + $dbh = $cxn->dbh(); + PTDEBUG && _d($cxn->name, $sql); + } + + my $row = $dbh->selectrow_arrayref($sql); return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; } @@ -11351,6 +11368,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-upgrade 3.0.2 +pt-upgrade 3.0.4 =cut diff --git a/bin/pt-variable-advisor b/bin/pt-variable-advisor index ae0ffc9a..72df7372 100755 --- a/bin/pt-variable-advisor +++ b/bin/pt-variable-advisor @@ -44,7 +44,7 @@ BEGIN { { package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; @@ -6188,6 +6188,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-variable-advisor 3.0.2 +pt-variable-advisor 3.0.4 =cut diff --git a/bin/pt-visual-explain b/bin/pt-visual-explain index 445f9ecf..381789cd 100755 --- a/bin/pt-visual-explain +++ b/bin/pt-visual-explain @@ -3281,6 +3281,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -pt-visual-explain 3.0.2 +pt-visual-explain 3.0.4 =cut diff --git a/config/deb/changelog b/config/deb/changelog index 3b8c3bf4..8e5d7b6e 100644 --- a/config/deb/changelog +++ b/config/deb/changelog @@ -1,3 +1,44 @@ +percona-toolkit (3.0.4-1) unstable; urgency=low + + * Fixed bug PT-181 : pt-online-schema-change not in sync with modules (Thanks Daniël van Eeden) + * Fixed bug PT-180 : pt-online-schema-change --skip-check-slave-lag doesn't work + * Fixed bug PT-178 : pt-online-schema-change appears to ignore the --check-slave-lag option + * Fixed bug PT-162 : Updated pt-table-checksum ignored dbs (Thanks Agustin Gallego) + * Fixed bug PT-161 : Safely check for undefined values in --skip-check-slave-lag (Thanks Chris Swingler) + * Fixed bug PT-154 : pt-online-schema-change --no-use-insert-ignore is broken + * Fixed bug PT-153 : pt-online-schema-change data loss when adding unique keys + * Fixed bug PT-151 : point is not decimal + * Fixed bug PT-148 : pt-osc Use of uninitialized value in printf + * Fixed bug PT-146 : Turn off statement based binlog checks + * Fixed bug PT-144 : Constraint name is too long (> 64 chars) + * Fixed bug PT-143 : pt-archiver SELECT query fails because of primary key + * Fixed bug PT-142 : pt-online-schema-change find_child_tables slow + * Fixed bug PT-138 : Added --output-format option to pt-mongodb-summary + * Fixed bug PT-136 : pt-table-checksum fails with columns having different collation/charset + * Feature PT-173 : Enable pt-table-checksum to ensure stale data is removed + * Feature PT-141 : pt-archiver archive records into csv file + * Feature PT-91 : Make pt-osc compatible with AFTER triggers + * Feature PT-90 : pt-stalk: Collect information about prepared statements if P_S is enabled (Thanks Agustin Gallego) + + -- Percona Toolkit Developers Tue, 01 Aug 2017 09:35:45 +0000 + +percona-toolkit (3.0.3-1) unstable; urgency=low + + * Fixed bug PT-133 : Sandbox won't start correctly if autocommit=0 in my.cnf + * Fixed bug PT-132 : pt-online-schema-change should imply --no-drop-new-table + * Fixed bug PT-130 : Fixed pt-mext not working with not empty Rsa_public_key + * Fixed bug PT-128 : pt-stalk ps include memory usage outputs + * Fixed bug PT-126 : Recognize comments in ALTER + * Fixed bug PT-116 : pt-online-schema change eats data on adding a unique index. Added --[no]use-insert-ignore + * Feature PT-115 : Make DSNs params able to be repeatable + * Fixed bug PT-115 : Made OptionParser to accept repeatable DSNs + * Fixed bug PT-111 : Collect MySQL variables + * Fixed bug PT-087 : Add --skip-check-slave-lag to pt-table-checksum + * Fixed bug PT-086 : Added --skip-check-slave-lag to pt-osc + * Fixed bug PT-080 : Added support for slave status in pt-stalk + + -- Percona Toolkit Developers Tue, 01 Aug 2017 10:23:25 +0000 + percona-toolkit (3.0.2-1) unstable; urgency=low * Fixed bug PT-73 : pt-mongodb tools add support for SSL connections diff --git a/config/deb/control.bak b/config/deb/control.bak deleted file mode 100644 index e5c7b578..00000000 --- a/config/deb/control.bak +++ /dev/null @@ -1,28 +0,0 @@ -Source: percona-toolkit -Section: utils -Priority: optional -Maintainer: Percona Toolkit Developers -Build-Depends: debhelper (>= 4.2) -Build-Depends-Indep: perl (>= 5.6.0-16) -Standards-Version: 3.7.2 -Homepage: http://www.percona.com/software/percona-toolkit/ -Vcs-Browser: https://github.com/percona/percona-toolkit -Vcs-Git: git://github.com/percona/percona-toolkit.git - -Package: percona-toolkit -Architecture: @@ARHITECTURE@@ -Depends: ${perl:Depends}, libdbi-perl (>= 1.13), libdbd-mysql-perl | libdbd-mysql-5.1-perl, libterm-readkey-perl (>=2.10), - libio-socket-ssl-perl -Description: Advanced MySQL and system command-line tools - Percona Toolkit is a collection of advanced command-line tools used by - Percona (http://www.percona.com/) support staff to perform a variety of - MySQL and system tasks that are too difficult or complex to perform manually. - . - These tools are ideal alternatives to private or "one-off" scripts because - they are professionally developed, formally tested, and fully documented. - They are also fully self-contained, so installation is quick and easy and - no libraries are installed. - . - Percona Toolkit is developed and supported by Percona. For more - information and other free, open-source software developed by Percona, - visit http://www.percona.com/software/. diff --git a/config/rpm/percona-toolkit.spec b/config/rpm/percona-toolkit.spec index 1a0bc80a..b2bddfc9 100644 --- a/config/rpm/percona-toolkit.spec +++ b/config/rpm/percona-toolkit.spec @@ -48,7 +48,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc COPYING INSTALL README Changelog +%doc COPYING INSTALL README.md Changelog %{_bindir}/* %{_mandir}/man1/*.1* diff --git a/config/rpm/percona-toolkit.spec.bak b/config/rpm/percona-toolkit.spec.bak deleted file mode 100644 index c3ebf1d4..00000000 --- a/config/rpm/percona-toolkit.spec.bak +++ /dev/null @@ -1,56 +0,0 @@ -Name: percona-toolkit -Summary: Advanced MySQL and system command-line tools -Version: %{version} -Release: %{release} -Group: Applications/Databases -License: GPLv2 -Vendor: Percona -URL: http://www.percona.com/software/percona-toolkit/ -Source: percona-toolkit-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildArch: @@ARHITECTURE@@ -Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Time::HiRes), perl(IO::Socket::SSL), perl(Digest::MD5), perl(Term::ReadKey) -AutoReq: no - -%description -Percona Toolkit is a collection of advanced command-line tools used by -Percona (http://www.percona.com/) support staff to perform a variety of -MySQL and system tasks that are too difficult or complex to perform manually. - -These tools are ideal alternatives to private or "one-off" scripts because -they are professionally developed, formally tested, and fully documented. -They are also fully self-contained, so installation is quick and easy and -no libraries are installed. - -Percona Toolkit is developed and supported by Percona. For more -information and other free, open-source software developed by Percona, -visit http://www.percona.com/software/. - -%prep -%setup -q - -%build -%{__perl} Makefile.PL INSTALLDIRS=vendor < /dev/null -make %{?_smp_mflags} - -%install -rm -rf $RPM_BUILD_ROOT -make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT -find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';' -find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';' -find $RPM_BUILD_ROOT -type f -name 'percona-toolkit.pod' -exec rm -f {} ';' -chmod -R u+w $RPM_BUILD_ROOT/* - - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root,-) -%doc COPYING INSTALL README Changelog -%{_bindir}/* -%{_mandir}/man1/*.1* - -%changelog -* Mon Jul 18 2011 Daniel Nichter -- Initial implementation diff --git a/config/sphinx-build/Makefile b/config/sphinx-build/Makefile index 8148d1eb..ca588868 100644 --- a/config/sphinx-build/Makefile +++ b/config/sphinx-build/Makefile @@ -39,10 +39,11 @@ clean: html: @echo "Downloading percona-theme ..." - @wget -O percona-theme.tar.gz http://percona.com/docs/theme/percona-toolkit/2.2 + @wget -O percona-theme.tar.gz https://www.percona.com/docs/theme-1-4/percona-toolkit/2.2 @rm -rf percona-theme @echo "Extracting theme." @tar -zxf percona-theme.tar.gz + @mv percona-theme-1-4 percona-theme @rm percona-theme.tar.gz @echo "Building html doc" $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/config/sphinx-build/conf.py b/config/sphinx-build/conf.py index 920cbe1d..95b78ff6 100644 --- a/config/sphinx-build/conf.py +++ b/config/sphinx-build/conf.py @@ -25,7 +25,7 @@ import sys, os # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.extlinks'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -50,7 +50,7 @@ copyright = u'2017, Percona LLC and/or its affiliates' # The short X.Y version. version = '3.0' # The full version, including alpha/beta/rc tags. -release = '3.0.2' +release = '3.0.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -86,7 +86,8 @@ pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] - +extlinks = {'jirabug': ('https://jira.percona.com/browse/%s', ''), +'lpbug': ('https://bugs.launchpad.net/percona-toolkit/+bug/%s', '#')} # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -189,6 +190,7 @@ latex_logo = 'percona-logo.jpg' # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False +latex_toplevel_sectioning = 'part' # If true, show page references after internal links. #latex_show_pagerefs = False diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..1f1901da --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' +services: + mongo: + image: ${MONGODB_IMAGE:-percona/percona-server-mongodb:3.4} + ports: + - "27017:27017" diff --git a/docs/installation.rst b/docs/installation.rst index 35666d00..c03718d9 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -1,178 +1,56 @@ -======================================= - Installation -======================================= +.. _install: -.. You can either download Percona Toolkit manually from the website - or use the official Percona software repositories for your system. +========================== +Installing Percona Toolkit +========================== -You can install Percona Toolkit 3.0.0 release candidate -from the official Percona software repositories for your system. +Percona provides packages for most popular 64-bit Linux distributions: -.. contents:: - :local: -.. - Downloading Percona Toolkit - =========================== - - Visit http://www.percona.com/software/percona-toolkit/ - to download the latest release of Percona Toolkit. - Alternatively, you can get the latest release using the command line: - - .. code-block:: bash - - wget percona.com/get/percona-toolkit.tar.gz - - wget percona.com/get/percona-toolkit.rpm - - wget percona.com/get/percona-toolkit.deb - - You can also get individual tools from the latest release: - - .. code-block:: bash - - wget percona.com/get/TOOL - - Replace ``TOOL`` with the name of any tool, for example:: - - wget percona.com/get/pt-summary +* Debian 7 ("wheezy") +* Debian 8 ("jessie") +* Ubuntu 14.04 LTS (Trusty Tahr) +* Ubuntu 16.04 LTS (Xenial Xerus) +* Ubuntu 16.10 (Yakkety Yak) +* Ubuntu 17.04 (Zesty Zapus) +* Red Hat Enterprise Linux or CentOS 6 (Santiago) +* Red Hat Enterprise Linux or CentOS 7 (Maipo) -Installing Percona Toolkit on Debian or Ubuntu -============================================== +.. note:: Percona Toolkit should work on other DEB-based and RPM-based systems + (for example, Oracle Linux and Amazon Linux AMI), + but it is tested only on those listed above. -1. Fetch the repository packages from Percona web: +It is recommended to install Percona software from official repositories: - .. code-block:: bash +1. Configure Percona repositories as described in + `Percona Software Repositories Documentation + `_. - wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb +#. Install Percona Toolkit using the corresponding package manager: -#. Install the downloaded package with :program:`dpkg` - by running the following command as root or with :program:`sudo`: - - .. code-block:: bash - - sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb - -#. Once you install this package, the Percona repositories should be added. - You can check the repository configuration - in the :file:`/etc/apt/sources.list.d/percona-release.list` file. - -#. Update the local cache: - - .. code-block:: bash - - sudo apt-get update - -#. Install the ``percona-toolkit`` package: - - .. code-block:: bash + * For Debian or Ubuntu:: sudo apt-get install percona-toolkit -.. _apt-testing-repo: + * For RHEL or CentOS:: -Testing and Experimental Repositories -------------------------------------- + sudo yum install percona-toolkit -Percona offers pre-release builds from the testing repo, -and early-stage development builds from the experimental repo. -To enable them, add either ``testing`` or ``experimental`` at the end -of the Percona repository definition in your repository file -(by default, :file:`/etc/apt/sources.list.d/percona-release.list`). +Alternative Install Methods +=========================== -For example, if you are running Debian 8 ("jessie") -and want to install the latest testing builds, -the definitions should look like this:: +You can also download the packages from the +`Percona web site `_ +and install it using tools like ``dpkg`` and ``rpm``, +depending on your system. +For example, to download the package for Debian 8 ("jessie"), +run the following:: - deb http://repo.percona.com/apt jessie main testing - deb-src http://repo.percona.com/apt jessie main testing + wget https://www.percona.com/downloads/percona-toolkit/3.0.3/binary/debian/jessie/x86_64/percona-toolkit_3.0.3-1.jessie_amd64.deb -If you are running Ubuntu 14.04 LTS (Trusty Tahr) -and want to install the latest experimental builds, -the definitions should look like this:: +If you want to download a specific tool, use the following address: +http://www.percona.com/get - deb http://repo.percona.com/apt trusty main experimental - deb-src http://repo.percona.com/apt trusty main experimental +For example, to download the ``pt-summary`` tool, run:: -Pinning the Packages --------------------- - -If you want to pin your packages to avoid upgrades, -create a new file :file:`/etc/apt/preferences.d/00percona.pref` -and add the following lines to it:: - - Package: * - Pin: release o=Percona Development Team - Pin-Priority: 1001 - -For more information about pinning, -refer to the official `Debian Wiki `_. - -Installing Percona Toolkit on Red Hat or CentOS -=============================================== - -1. Install the Percona repository package: - - .. code-block:: bash - - $ sudo yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm - - You should see the following if successful: :: - - Installed: - percona-release.noarch 0:0.1-4 - - Complete! - -#. Check that the packages are available: - - .. code-block:: bash - - $ yum list | grep percona-toolkit - - You should see output similar to the following: - - .. code-block:: text - - percona-toolkit.noarch 3.0.0-rc percona-release-noarch - -#. Install the |PSMDB| packages: - - .. code-block:: bash - - $ sudo yum install percona-toolkit - -.. _yum-testing-repo: - -Testing and Experimental Repositories -------------------------------------- - -Percona offers pre-release builds from the testing repo, -and early-stage development builds from the experimental repo. -You can enable either one in the Percona repository configuration file -:file:`/etc/yum.repos.d/percona-release.repo`. -There are three sections in this file, -for configuring corresponding repositories: - -* stable release -* testing -* experimental - -The latter two repositories are disabled by default. - -If you want to install the latest testing builds, -set ``enabled=1`` for the following entries: :: - - [percona-testing-$basearch] - [percona-testing-noarch] - -If you want to install the latest experimental builds, -set ``enabled=1`` for the following entries: :: - - [percona-experimental-$basearch] - [percona-experimental-noarch] - -.. note:: As of version 3.0, - Percona Toolkit is not available in the ``noarch`` repo. - Make sure that you enable the ``basearch`` repo - when installing or upgrading to Percona Toolkit 3.0 or later. + wget percona.com/get/pt-summary diff --git a/docs/percona-toolkit.pod b/docs/percona-toolkit.pod index 1a5eb44a..322f735d 100644 --- a/docs/percona-toolkit.pod +++ b/docs/percona-toolkit.pod @@ -560,6 +560,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA. =head1 VERSION -Percona Toolkit v3.0.2 released 2017-03-23 +Percona Toolkit v3.0.4 released 2017-08-02 =cut diff --git a/docs/release_notes.rst b/docs/release_notes.rst index a839c8c5..d96bf8cd 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -1,6 +1,116 @@ Release Notes ************* +v3.0.4 released 2017-08-02 +========================== + +Percona Toolkit 3.0.4 includes the following changes: + +New Features + +* :jirabug:`PT-90`: Added collection of information about prepared statements + by ``pt-stalk`` when Performance Schema is enabled. + For more information, see :lpbug:`1642750`. + +* :jirabug:`PT-91`: Added the ``--preserve-triggers`` option + for ``pt-online-schema-change`` to support ``AFTER`` triggers. + +* :jirabug:`PT-138`: Added ``--output-format`` option + for ``pt-mongodb-summary`` to choose between JSON format + and the default plain text. + +* :jirabug:`PT-141`: Added the ``--output-format=csv`` parameter + for ``pt-archiver`` to archive rows in CSV format. + +* :jirabug:`PT-142`: Added the ``--only-same-schema-fks`` option + for ``pt-online-schema-change`` to check foreigns keys only on tables + with the same schema as the original table. + This should speed up the tool's execution, + but keep in mind that if you have foreign keys + referencing tables in other schemas, + they won't be detected. + For more information, see :lpbug:`1690122`. + +* :jirabug:`PT-153`: Added the ``--check-unique-key-change`` option + for ``pt-online-schema-change`` to abort + if the specified statement for ``--alter`` is trying to add a unique index. + This is supposed to avoid adding duplicate keys + that might lead to silently losing data. + +* :jirabug:`PT-173`: Added the ``--truncate-replicate-table`` option + for ``pt-table-checksum`` to ensure stale data is removed. + +Bug fixes + +* :jirabug:`PT-136`: Fixed ``pt-table-checksum`` to support tables + that have columns with different collations or charsets. + For more information, see :lpbug:`1674266`. + +* :jirabug:`PT-143`: Fixed primary key handling by ``pt-archiver``. + For more information, see :lpbug:`1691630`. + +* :jirabug:`PT-144`: Limited constraint name in the new table + when running ``pt-online-schema-change``. + For more information, see :lpbug:`1491674`. + +* :jirabug:`PT-146`: Fixed the ``--no-check-binlog-format`` option + for ``pt-table-checksum`` to work as expected. + +* :jirabug:`PT-148`: Fixed the use of uninitialized value in ``printf()`` + for ``pt-online-schema-change``. + For more information, see :lpbug:`1693614`. + +* :jirabug:`PT-151`: Fixed ``pt-table-sync`` to prevent field type ``point`` + to be taken as decimal. + +* :jirabug:`PT-154`: Reverted :jirabug:`PT-116` + to remove the ``--use-insert-ignore`` option + from ``pt-online-schema-change``. + +* :jirabug:`PT-161`: Fixed the ``--skip-check-slave-lag`` feature + for ``pt-table-checksum`` to safely check for undefined values. + +* :jirabug:`PT-178`: Fixed regression in ``--check-slave-lag`` option + for ``pt-online-schema-change``. + +* :jirabug:`PT-180`: Fixed regression in ``--skip-check-slave-lag`` option + for ``pt-online-schema-change``. + +* :jirabug:`PT-181`: Fixed syntax error in ``pt-online-schema-change``. + +Other Improvements + +* :jirabug:`PT-162`: Updated list of tables ignored by ``pt-table-checksum``. + +v3.0.3 released 2017-05-18 +========================== + +Percona Toolkit 3.0.3 includes the following changes: + +New Features + +* Added the ``--skip-check-slave-lag`` option for ``pt-table-checksum``, ``pt-online-schema-change``, and ``pt-archiver``. + + This option can be used to specify list of servers where to skip checking for slave lag. + +* 1642754: Added support for collecting replication slave information in ``pt-stalk``. + +* PT-111: Added support for collecting information about variables from Performance Schema in ``pt-stalk``. For more information, see 1642753. + +* PT-116: Added the ``--[no]use-insert-ignore`` option for ``pt-online-schema-change`` to force or prevent using ``IGNORE`` on ``INSERT`` statements. For more information, see 1545129. + +Bug Fixes + +* PT-115: Fixed ``OptionParser`` to accept repeatable DSNs. + +* PT-126: Fixed ``pt-online-schema-change`` to correctly parse comments. For more information, see 1592072. + +* PT-128: Fixed ``pt-stalk`` to include memory usage information. For more information, see 1510809. + +* PT-130: Fixed ``pt-mext`` to work with non-empty RSA public key. For more information, see 1587404. + +* PT-132: Fixed ``pt-online-schema-change`` to enable ``--no-drop-new-table`` when ``--no-swap-tables`` and ``--no-drop-triggers`` are used. + v3.0.2 released 2017-03-27 ========================== diff --git a/glide.lock b/glide.lock index 7a46cd3b..3d8c6b1e 100644 --- a/glide.lock +++ b/glide.lock @@ -1,14 +1,14 @@ -hash: 7cc97c518c04beac5926bfef5fafc2c291d1c8eff945390edb5e71fecbf461f2 -updated: 2017-04-11T11:01:58.383683464-03:00 +hash: 6d30e29455f610ee47cc43bafd9390da029e7fe8cf5dafe510e423e9c0e897a0 +updated: 2017-08-31T20:21:56.600678687+02:00 imports: - name: github.com/bradfitz/slice version: d9036e2120b5ddfa53f3ebccd618c4af275f47da - name: github.com/go-ole/go-ole - version: de8695c8edbf8236f30d6e1376e20b198a028d42 + version: 02d3668a0cf01f58411cc85cd37c174c257ec7c2 subpackages: - oleutil - name: github.com/golang/mock - version: bd3c8e81be01eef76d4b503f5e687d2d1354d2d9 + version: 93f6609a15b7de76bd49259f1f9a6b58df358936 subpackages: - gomock - name: github.com/hashicorp/go-version @@ -17,22 +17,24 @@ imports: version: bf9dde6d0d2c004a008c27aaee91170c786f6db8 - name: github.com/kr/pretty version: cfb55aafdaf3ec08f0db22699ab822c50091b1c4 +- name: github.com/Masterminds/semver + version: 517734cc7d6470c0d07130e40fd40bdeb9bcd3fd - name: github.com/montanaflynn/stats - version: eeaced052adbcfeea372c749c281099ed7fdaa38 + version: 41c34e4914ec3c05d485e564d9028d8861d5d9ad - name: github.com/pborman/getopt version: 7148bc3a4c3008adfcab60cbebfd0576018f330b subpackages: - v2 - name: github.com/percona/pmgo - version: 9566dc76df319b856a12f24a3b6852a0c6463eff + version: 43e01b1a87fe20317bf4329d4ab3cb8d58d50886 subpackages: - pmgomock - name: github.com/pkg/errors - version: 645ef00459ed84a119197bfb8d8205042c6df63d + version: c605e284fe17294bda444b34710735b29d1a9d90 - name: github.com/satori/go.uuid - version: 879c5887cd475cd7864858769793b2ceb0d44feb + version: 5bf94b69c6b68ee1b541973bb8e1144db23a194b - name: github.com/shirou/gopsutil - version: e49a95f3d5f824c3f9875ca49e54e4fef17f82cf + version: 09e98597147f04686f71603d5525627cd066701d subpackages: - cpu - host @@ -43,25 +45,26 @@ imports: - name: github.com/shirou/w32 version: bb4de0191aa41b5507caa14b0650cdbddcd9280b - name: github.com/sirupsen/logrus - version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f + version: 89742aefa4b206dcf400792f3bd35b542998eb3b - name: github.com/StackExchange/wmi - version: e542ed97d15e640bdc14b5c12162d59e8fc67324 + version: ea383cf3ba6ec950874b8486cd72356d007c768f - name: go4.org - version: 7ce08ca145dbe0e66a127c447b80ee7914f3e4f9 + version: 034d17a462f7b2dcd1a4a73553ec5357ff6e6c6e subpackages: - reflectutil - name: golang.org/x/crypto - version: 453249f01cfeb54c3d549ddb75ff152ca243f9d8 + version: 3627ff35f31987174dbee61d9d1dcc1c643e7174 subpackages: - ssh/terminal - name: golang.org/x/net - version: 61557ac0112b576429a0df080e1c2cef5dfbb642 + version: 054b33e6527139ad5b1ec2f6232c3b175bd9a30c subpackages: - context - name: golang.org/x/sys - version: e24f485414aeafb646f6fca458b0bf869c0880a1 + version: abf9c25f54453410d0c6668e519582a9e1115027 subpackages: - unix + - windows - name: gopkg.in/mgo.v2 version: 3f83fa5005286a7fe593b055f0d7771a7dce4655 subpackages: diff --git a/glide.yaml b/glide.yaml index c4ef7088..54eb5ee6 100644 --- a/glide.yaml +++ b/glide.yaml @@ -7,7 +7,6 @@ import: - package: github.com/montanaflynn/stats - package: github.com/pborman/getopt - package: github.com/percona/pmgo - version: ^0.4 - package: github.com/pkg/errors - package: github.com/satori/go.uuid - package: github.com/shirou/gopsutil @@ -17,6 +16,7 @@ import: - package: gopkg.in/mgo.v2 subpackages: - bson +- package: github.com/Masterminds/semver testImport: - package: github.com/golang/mock subpackages: diff --git a/lib/Cxn.pm b/lib/Cxn.pm index 1dd6ed18..a80f2601 100644 --- a/lib/Cxn.pm +++ b/lib/Cxn.pm @@ -228,6 +228,11 @@ sub name { return $self->{hostname} || $self->{dsn_name} || 'unknown host'; } +sub description { + my ($self) = @_; + return sprintf("%s -> %s:%s", $self->name(), $self->{dsn}->{h}, $self->{dsn}->{P} || 'socket'); +} + # This returns the server_id. # For cluster nodes, since server_id is unreliable, we use a combination of # variables to create an id string that is unique. diff --git a/lib/MySQLStatusWaiter.pm b/lib/MySQLStatusWaiter.pm index 99177be6..f06e4f02 100644 --- a/lib/MySQLStatusWaiter.pm +++ b/lib/MySQLStatusWaiter.pm @@ -175,7 +175,7 @@ sub wait { die "$var=$val exceeds its critical threshold " . "$self->{critical_val_for}->{$var}\n"; } - if ( !$val || $val >= $self->{max_val_for}->{$var} ) { + if ( $val >= $self->{max_val_for}->{$var} ) { $vals_too_high{$var} = $val; } else { diff --git a/lib/Percona/Toolkit.pm b/lib/Percona/Toolkit.pm index ff8109bb..fe10aa30 100644 --- a/lib/Percona/Toolkit.pm +++ b/lib/Percona/Toolkit.pm @@ -18,7 +18,7 @@ # ########################################################################### package Percona::Toolkit; -our $VERSION = '3.0.3'; +our $VERSION = '3.0.4'; use strict; use warnings FATAL => 'all'; diff --git a/lib/Processlist.pm b/lib/Processlist.pm index 0546b1ce..a953a1c6 100644 --- a/lib/Processlist.pm +++ b/lib/Processlist.pm @@ -69,6 +69,19 @@ sub new { foreach my $arg ( qw(MasterSlave) ) { die "I need a $arg argument" unless $args{$arg}; } + # Convert the list of kill commands (Query, Execute, etc) to a hashref for + # faster check later + my $kill_busy_commands = {}; + if ($args{kill_busy_commands}) { + for my $command (split /,/,$args{kill_busy_commands}) { + $command =~ s/^\s+|\s+$//g; + $kill_busy_commands->{$command} = 1; + } + } else { + $kill_busy_commands->{Query} = 1; + } + $args{kill_busy_commands} = $kill_busy_commands; + my $self = { %args, polls => 0, @@ -471,6 +484,7 @@ sub find { my $ms = $self->{MasterSlave}; my @matches; + $self->{_reasons_for_matching} = undef; QUERY: foreach my $query ( @$proclist ) { PTDEBUG && _d('Checking query', Dumper($query)); @@ -484,7 +498,8 @@ sub find { } # Match special busy_time. - if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + #if ( $find_spec{busy_time} && ($query->{Command} || '') eq 'Query' ) { + if ( $find_spec{busy_time} && exists($self->{kill_busy_commands}->{$query->{Command} || ''}) ) { next QUERY unless defined($query->{Time}); if ( $query->{Time} < $find_spec{busy_time} ) { PTDEBUG && _d("Query isn't running long enough"); diff --git a/lib/ReplicaLagWaiter.pm b/lib/ReplicaLagWaiter.pm index 4d0b1a35..194406e0 100644 --- a/lib/ReplicaLagWaiter.pm +++ b/lib/ReplicaLagWaiter.pm @@ -80,26 +80,6 @@ sub wait { my $worst; # most lagging slave my $pr_callback; my $pr_first_report; - - ### refresh list of slaves. In: self passed to wait() - ### Returns: new slave list - my $pr_refresh_slave_list = sub { - my ($self) = @_; - my ($slaves, $refresher) = ($self->{slaves}, $self->{get_slaves_cb}); - return if ( not defined $refresher ); - my $before = join ' ', sort map {$_->name()} @$slaves; - $slaves = $refresher->(); - my $after = join ' ', sort map {$_->name()} @$slaves; - if ($before ne $after) { - $self->{slaves} = $slaves; - printf "Slave set to watch has changed\n Was: %s\n Now: %s\n", - $before, $after; - } - return($self->{slaves}); - }; - - $slaves = $pr_refresh_slave_list->($self); - if ( $pr ) { # If you use the default Progress report callback, you'll need to # to add Transformers.pm to this tool. @@ -133,15 +113,6 @@ sub wait { my @lagged_slaves = map { {cxn=>$_, lag=>undef} } @$slaves; while ( $oktorun->() && @lagged_slaves ) { PTDEBUG && _d('Checking slave lag'); - - ### while we were waiting our list of slaves may have changed... - $slaves = $pr_refresh_slave_list->($self); - my $watched = 0; - @lagged_slaves = grep { - my $slave_name = $_->{cxn}->name(); - grep {$slave_name eq $_->name()} @{$slaves // []} - } @lagged_slaves; - for my $i ( 0..$#lagged_slaves ) { my $lag = $get_lag->($lagged_slaves[$i]->{cxn}); PTDEBUG && _d($lagged_slaves[$i]->{cxn}->name(), diff --git a/lib/SchemaIterator.pm b/lib/SchemaIterator.pm index 923b894d..4c51ae40 100644 --- a/lib/SchemaIterator.pm +++ b/lib/SchemaIterator.pm @@ -456,22 +456,15 @@ sub table_is_allowed { # Always auto-skip these pseudo tables. return 0 if $db eq 'mysql' && $tbl =~ m/^(?: general_log - |gtid_execution + |gtid_executed |innodb_index_stats |innodb_table_stats - |inventory - |plugin - |proc |slave_master_info |slave_relay_log_info |slave_worker_info |slow_log )$/x; - return 0 if $db eq 'sys' && $tbl =~ m/^(?: - sys_config - )$/x; - if ( $filter->{'ignore-tables'}->{'*'}->{$tbl} || $filter->{'ignore-tables'}->{$db}->{$tbl}) { PTDEBUG && _d('Table', $tbl, 'is in --ignore-tables list'); diff --git a/lib/TableParser.pm b/lib/TableParser.pm index 2f7521f6..511c5c67 100644 --- a/lib/TableParser.pm +++ b/lib/TableParser.pm @@ -145,7 +145,7 @@ sub parse { # Lowercase identifiers to avoid issues with case-sensitivity in Perl. # (Bug #1910276). - $ddl =~ s/(`[^`]+`)/\L$1/g; + $ddl =~ s/(`[^`\n]+`)/\L$1/gm; my $engine = $self->get_engine($ddl); @@ -159,8 +159,8 @@ sub parse { # Find column types, whether numeric, whether nullable, whether # auto-increment. - my (@nums, @null); - my (%type_for, %is_nullable, %is_numeric, %is_autoinc); + my (@nums, @null, @non_generated); + my (%type_for, %is_nullable, %is_numeric, %is_autoinc, %is_generated); foreach my $col ( @cols ) { my $def = $def_for{$col}; @@ -180,6 +180,11 @@ sub parse { push @null, $col; $is_nullable{$col} = 1; } + if ( remove_quoted_text($def) =~ m/\WGENERATED\W/i ) { + $is_generated{$col} = 1; + } else { + push @non_generated, $col; + } $is_autoinc{$col} = $def =~ m/AUTO_INCREMENT/i ? 1 : 0; } @@ -191,24 +196,34 @@ sub parse { my ($charset) = $ddl =~ m/DEFAULT CHARSET=(\w+)/; return { - name => $name, - cols => \@cols, - col_posn => { map { $cols[$_] => $_ } 0..$#cols }, - is_col => { map { $_ => 1 } @cols }, - null_cols => \@null, - is_nullable => \%is_nullable, - is_autoinc => \%is_autoinc, - clustered_key => $clustered_key, - keys => $keys, - defs => \%def_for, - numeric_cols => \@nums, - is_numeric => \%is_numeric, - engine => $engine, - type_for => \%type_for, - charset => $charset, + name => $name, + cols => \@cols, + col_posn => { map { $cols[$_] => $_ } 0..$#cols }, + is_col => { map { $_ => 1 } @non_generated }, + null_cols => \@null, + is_nullable => \%is_nullable, + non_generated_cols => \@non_generated, + is_autoinc => \%is_autoinc, + is_generated => \%is_generated, + clustered_key => $clustered_key, + keys => $keys, + defs => \%def_for, + numeric_cols => \@nums, + is_numeric => \%is_numeric, + engine => $engine, + type_for => \%type_for, + charset => $charset, }; } +sub remove_quoted_text { + my ($string) = @_; + $string =~ s/[^\\]`[^`]*[^\\]`//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + $string =~ s/[^\\]"[^"]*[^\\]"//g; + return $string; +} + # Sorts indexes in this order: PRIMARY, unique, non-nullable, any (shortest # first, alphabetical). Only BTREE indexes are considered. # TODO: consider length as # of bytes instead of # of columns. diff --git a/lib/bash/collect.sh b/lib/bash/collect.sh index 03a51c70..c3f8f221 100644 --- a/lib/bash/collect.sh +++ b/lib/bash/collect.sh @@ -100,9 +100,7 @@ collect() { $CMD_MYSQLADMIN $EXT_ARGV debug else log "Could not find the MySQL error log" - fi - - + fi # Get a sample of these right away, so we can get these without interaction # with the other commands we're about to run. if [ "${mysql_version}" '>' "5.1" ]; then @@ -252,6 +250,10 @@ collect() { ps_locks_transactions "$d/$p-ps-locks-transactions" fi + if [ "${mysql_version}" '>' "5.6" ]; then + (echo $ts; ps_prepared_statements) >> "$d/$p-prepared-statements" & + fi + slave_status "$d/$p-slave-status" "${mysql_version}" curr_time=$(date +'%s') @@ -430,6 +432,13 @@ ps_locks_transactions() { } +ps_prepared_statements() { + $CMD_MYSQL $EXT_ARGV -e "SELECT t.processlist_id, pse.* \ + FROM performance_schema.prepared_statements_instances pse \ + JOIN performance_schema.threads t \ + ON (pse.OWNER_THREAD_ID=t.thread_id)\G" +} + slave_status() { local outfile=$1 local mysql_version=$2 diff --git a/lib/bash/collect_mysql_info.sh b/lib/bash/collect_mysql_info.sh index dd131633..92558be7 100644 --- a/lib/bash/collect_mysql_info.sh +++ b/lib/bash/collect_mysql_info.sh @@ -116,6 +116,10 @@ collect_mysql_users () { $CMD_MYSQL $EXT_ARGV -ss -e 'SELECT COUNT(*), SUM(user=""), SUM(password=""), SUM(password NOT LIKE "*%") FROM mysql.user' 2>/dev/null } +collect_mysql_show_slave_hosts () { + $CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW SLAVE HOSTS' 2>/dev/null +} + collect_master_logs_status () { local master_logs_file="$1" local master_status_file="$2" @@ -224,6 +228,7 @@ collect_mysql_info () { collect_mysqld_instances "$dir/mysql-variables" > "$dir/mysqld-instances" collect_mysqld_executables "$dir/mysqld-instances" > "$dir/mysqld-executables" + collect_mysql_show_slave_hosts "$dir/mysql-slave-hosts" > "$dir/mysql-slave-hosts" local binlog="$(get_var log_bin "$dir/mysql-variables")" if [ "${binlog}" ]; then diff --git a/sandbox/servers/5.6/my.sandbox.cnf b/sandbox/servers/5.6/my.sandbox.cnf index 24bfa584..3ee3f791 100644 --- a/sandbox/servers/5.6/my.sandbox.cnf +++ b/sandbox/servers/5.6/my.sandbox.cnf @@ -26,3 +26,4 @@ log-error = /tmp/PORT/data/mysqld.log innodb_lock_wait_timeout = 3 general_log general_log_file = genlog +secure-file-priv = diff --git a/sandbox/servers/mariadb/10.2/data.tar.gz b/sandbox/servers/mariadb/10.2/data.tar.gz new file mode 100644 index 00000000..00cdc4ff Binary files /dev/null and b/sandbox/servers/mariadb/10.2/data.tar.gz differ diff --git a/sandbox/servers/mariadb/10.2/my.sandbox.cnf b/sandbox/servers/mariadb/10.2/my.sandbox.cnf new file mode 100644 index 00000000..cc142452 --- /dev/null +++ b/sandbox/servers/mariadb/10.2/my.sandbox.cnf @@ -0,0 +1,29 @@ +[client] +user = msandbox +password = msandbox +port = PORT +socket = /tmp/PORT/mysql_sandboxPORT.sock + +[mysqld] +port = PORT +socket = /tmp/PORT/mysql_sandboxPORT.sock +pid-file = /tmp/PORT/data/mysql_sandboxPORT.pid +basedir = PERCONA_TOOLKIT_SANDBOX +datadir = /tmp/PORT/data +key_buffer_size = 16M +innodb_buffer_pool_size = 16M +innodb_data_home_dir = /tmp/PORT/data +innodb_log_group_home_dir = /tmp/PORT/data +innodb_data_file_path = ibdata1:10M:autoextend +innodb_log_file_size = 64M +log-bin = mysql-bin +relay_log = mysql-relay-bin +log_slave_updates +server-id = PORT +report-host = 127.0.0.1 +report-port = PORT +log-error = /tmp/PORT/data/mysqld.log +innodb_lock_wait_timeout = 3 +general_log +general_log_file = genlog +performance_schema = ON diff --git a/sandbox/servers/mariadb/10.2/system_idb_tables.sql b/sandbox/servers/mariadb/10.2/system_idb_tables.sql new file mode 100644 index 00000000..c1393192 --- /dev/null +++ b/sandbox/servers/mariadb/10.2/system_idb_tables.sql @@ -0,0 +1,627 @@ +USE `mysql`; + +-- MySQL dump 10.16 Distrib 10.1.21-MariaDB, for Linux (x86_64) +-- +-- Host: localhost Database: localhost +-- ------------------------------------------------------ +-- Server version 10.1.21-MariaDB + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `column_stats` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `column_stats` ( + `db_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(64) COLLATE utf8_bin NOT NULL, + `column_name` varchar(64) COLLATE utf8_bin NOT NULL, + `min_value` varbinary(255) DEFAULT NULL, + `max_value` varbinary(255) DEFAULT NULL, + `nulls_ratio` decimal(12,4) DEFAULT NULL, + `avg_length` decimal(12,4) DEFAULT NULL, + `avg_frequency` decimal(12,4) DEFAULT NULL, + `hist_size` tinyint(3) unsigned DEFAULT NULL, + `hist_type` enum('SINGLE_PREC_HB','DOUBLE_PREC_HB') COLLATE utf8_bin DEFAULT NULL, + `histogram` varbinary(255) DEFAULT NULL, + PRIMARY KEY (`db_name`,`table_name`,`column_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Columns'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `columns_priv` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `columns_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `db` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `db` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + PRIMARY KEY (`Host`,`Db`,`User`), + KEY `User` (`User`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `event` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `event` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `body` longblob NOT NULL, + `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `execute_at` datetime DEFAULT NULL, + `interval_value` int(11) DEFAULT NULL, + `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_executed` datetime DEFAULT NULL, + `starts` datetime DEFAULT NULL, + `ends` datetime DEFAULT NULL, + `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', + `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `originator` int(10) unsigned NOT NULL, + `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `func` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `func` ( + `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `ret` tinyint(1) NOT NULL DEFAULT '0', + `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', + `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `gtid_slave_pos` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `gtid_slave_pos` ( + `domain_id` int(10) unsigned NOT NULL, + `sub_id` bigint(20) unsigned NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `seq_no` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`domain_id`,`sub_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Replication slave GTID position'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `help_category` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `help_category` ( + `help_category_id` smallint(5) unsigned NOT NULL, + `name` char(64) NOT NULL, + `parent_category_id` smallint(5) unsigned DEFAULT NULL, + `url` text NOT NULL, + PRIMARY KEY (`help_category_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help categories'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `help_keyword` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `help_keyword` ( + `help_keyword_id` int(10) unsigned NOT NULL, + `name` char(64) NOT NULL, + PRIMARY KEY (`help_keyword_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help keywords'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `help_relation` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `help_relation` ( + `help_topic_id` int(10) unsigned NOT NULL, + `help_keyword_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`help_keyword_id`,`help_topic_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='keyword-topic relation'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `help_topic` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `help_topic` ( + `help_topic_id` int(10) unsigned NOT NULL, + `name` char(64) NOT NULL, + `help_category_id` smallint(5) unsigned NOT NULL, + `description` text NOT NULL, + `example` text NOT NULL, + `url` text NOT NULL, + PRIMARY KEY (`help_topic_id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help topics'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `host` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `host` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + PRIMARY KEY (`Host`,`Db`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `index_stats` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `index_stats` ( + `db_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(64) COLLATE utf8_bin NOT NULL, + `index_name` varchar(64) COLLATE utf8_bin NOT NULL, + `prefix_arity` int(11) unsigned NOT NULL, + `avg_frequency` decimal(12,4) DEFAULT NULL, + PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Indexes'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `innodb_index_stats` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `innodb_index_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(64) COLLATE utf8_bin NOT NULL, + `index_name` varchar(64) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `stat_name` varchar(64) COLLATE utf8_bin NOT NULL, + `stat_value` bigint(20) unsigned NOT NULL, + `sample_size` bigint(20) unsigned DEFAULT NULL, + `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `innodb_table_stats` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `innodb_table_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(64) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `n_rows` bigint(20) unsigned NOT NULL, + `clustered_index_size` bigint(20) unsigned NOT NULL, + `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`database_name`,`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `plugin` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `plugin` ( + `name` varchar(64) NOT NULL DEFAULT '', + `dl` varchar(128) NOT NULL DEFAULT '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `proc` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `proc` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `type` enum('FUNCTION','PROCEDURE') NOT NULL, + `specific_name` char(64) NOT NULL DEFAULT '', + `language` enum('SQL') NOT NULL DEFAULT 'SQL', + `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', + `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', + `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', + `param_list` blob NOT NULL, + `returns` longblob NOT NULL, + `body` longblob NOT NULL, + `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `procs_priv` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `procs_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '', + `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, + `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `proxies_priv` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `proxies_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_user` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `With_grant` tinyint(1) NOT NULL DEFAULT '0', + `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `roles_mapping` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `roles_mapping` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Admin_option` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + UNIQUE KEY `Host` (`Host`,`User`,`Role`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Granted roles'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `servers` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `servers` ( + `Server_name` char(64) NOT NULL DEFAULT '', + `Host` char(64) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `Username` char(80) NOT NULL DEFAULT '', + `Password` char(64) NOT NULL DEFAULT '', + `Port` int(4) NOT NULL DEFAULT '0', + `Socket` char(64) NOT NULL DEFAULT '', + `Wrapper` char(64) NOT NULL DEFAULT '', + `Owner` char(64) NOT NULL DEFAULT '', + PRIMARY KEY (`Server_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `table_stats` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `table_stats` ( + `db_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(64) COLLATE utf8_bin NOT NULL, + `cardinality` bigint(21) unsigned DEFAULT NULL, + PRIMARY KEY (`db_name`,`table_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Statistics on Tables'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `tables_priv` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `tables_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `time_zone` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `time_zone` ( + `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N', + PRIMARY KEY (`Time_zone_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `time_zone_leap_second` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `time_zone_leap_second` ( + `Transition_time` bigint(20) NOT NULL, + `Correction` int(11) NOT NULL, + PRIMARY KEY (`Transition_time`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Leap seconds information for time zones'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `time_zone_name` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `time_zone_name` ( + `Name` char(64) NOT NULL, + `Time_zone_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`Name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone names'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `time_zone_transition` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `time_zone_transition` ( + `Time_zone_id` int(10) unsigned NOT NULL, + `Transition_time` bigint(20) NOT NULL, + `Transition_type_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`Time_zone_id`,`Transition_time`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transitions'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `time_zone_transition_type` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `time_zone_transition_type` ( + `Time_zone_id` int(10) unsigned NOT NULL, + `Transition_type_id` int(10) unsigned NOT NULL, + `Offset` int(11) NOT NULL DEFAULT '0', + `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Abbreviation` char(8) NOT NULL DEFAULT '', + PRIMARY KEY (`Time_zone_id`,`Transition_type_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `user` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `user` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '', + `ssl_cipher` blob NOT NULL, + `x509_issuer` blob NOT NULL, + `x509_subject` blob NOT NULL, + `max_questions` int(11) unsigned NOT NULL DEFAULT '0', + `max_updates` int(11) unsigned NOT NULL DEFAULT '0', + `max_connections` int(11) unsigned NOT NULL DEFAULT '0', + `max_user_connections` int(11) NOT NULL DEFAULT '0', + `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '', + `authentication_string` text COLLATE utf8_bin NOT NULL, + `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', + `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '', + `max_statement_time` decimal(12,6) NOT NULL DEFAULT '0.000000', + PRIMARY KEY (`Host`,`User`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `general_log` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `general_log` ( + `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `user_host` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `slow_log` +-- + +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `slow_log` ( + `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `user_host` mediumtext NOT NULL, + `query_time` time(6) NOT NULL, + `lock_time` time(6) NOT NULL, + `rows_sent` int(11) NOT NULL, + `rows_examined` int(11) NOT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `sql_text` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `rows_affected` int(11) NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2017-03-10 19:49:04 diff --git a/src/go/Makefile b/src/go/Makefile index 9722b52b..cda11d26 100644 --- a/src/go/Makefile +++ b/src/go/Makefile @@ -1,6 +1,6 @@ GO := go pkgs = $(shell find . -type d -name "pt-mongodb*" -exec basename {} \;) -VERSION="3.0.2" +VERSION="3.0.4" BUILD=$(shell date +%FT%T%z) GOVERSION=$(shell go version | cut --delimiter=" " -f3) diff --git a/src/go/lib/profiling/profiling.go b/src/go/lib/profiling/profiling.go new file mode 100644 index 00000000..40ef4cb3 --- /dev/null +++ b/src/go/lib/profiling/profiling.go @@ -0,0 +1,94 @@ +/* + Copyright (c) 2017, Percona LLC and/or its affiliates. All rights reserved. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see +*/ + +package profiling + +import ( + "github.com/percona/pmgo" + "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" +) + +func Enable(url string) error { + session, err := createSession(url) + if err != nil { + return err + } + defer session.Close() + + err = profile(session.DB(""), 2) + if err != nil { + return err + } + + return nil +} + +func Disable(url string) error { + session, err := createSession(url) + if err != nil { + return err + } + defer session.Close() + + err = profile(session.DB(""), 0) + if err != nil { + return err + } + + return nil +} + +func Drop(url string) error { + session, err := createSession(url) + if err != nil { + return err + } + defer session.Close() + + return session.DB("").C("system.profile").DropCollection() +} + +func profile(db pmgo.DatabaseManager, v int) error { + result := struct { + Was int + Slowms int + Ratelimit int + }{} + return db.Run( + bson.M{ + "profile": v, + }, + &result, + ) +} + +func createSession(url string) (pmgo.SessionManager, error) { + dialInfo, err := pmgo.ParseURL(url) + if err != nil { + return nil, err + } + dialer := pmgo.NewDialer() + + session, err := dialer.DialWithInfo(dialInfo) + if err != nil { + return nil, err + } + + session.SetMode(mgo.Eventual, true) + return session, nil +} diff --git a/src/go/lib/tutil/util.go b/src/go/lib/tutil/util.go index 3a4caa7e..3e3f8373 100644 --- a/src/go/lib/tutil/util.go +++ b/src/go/lib/tutil/util.go @@ -5,7 +5,10 @@ import ( "io/ioutil" "os" "os/exec" + "regexp" "strings" + + "gopkg.in/mgo.v2/bson" ) const ( @@ -44,13 +47,50 @@ func LoadJson(filename string, destination interface{}) error { return nil } +func LoadBson(filename string, destination interface{}) error { + file, err := os.Open(filename) + if err != nil { + return err + } + + buf, err := ioutil.ReadAll(file) + if err != nil { + return err + } + + // https://github.com/go-mgo/mgo/issues/363 + re := regexp.MustCompile(`" :`) + buf = re.ReplaceAll(buf, []byte(`":`)) + + // Using NumberLong is not supported + re = regexp.MustCompile(`NumberLong\((.*)\)`) + buf = re.ReplaceAll(buf, []byte(`$1`)) + + // Using regexp is not supported + // https://github.com/go-mgo/mgo/issues/363 + re = regexp.MustCompile(`(/.*/)`) + buf = re.ReplaceAll(buf, []byte(`"$1"`)) + + // Using functions is not supported + // https://github.com/go-mgo/mgo/issues/363 + re = regexp.MustCompile(`(?s): (function \(.*?\) {.*?})`) + buf = re.ReplaceAll(buf, []byte(`: ""`)) + + err = bson.UnmarshalJSON(buf, &destination) + if err != nil { + return err + } + + return nil +} + func WriteJson(filename string, data interface{}) error { buf, err := json.MarshalIndent(data, "", " ") if err != nil { return err } - err = ioutil.WriteFile(filename, buf, 777) + err = ioutil.WriteFile(filename, buf, 0777) if err != nil { return err } diff --git a/src/go/mongolib/explain/explain.go b/src/go/mongolib/explain/explain.go new file mode 100644 index 00000000..abc576b9 --- /dev/null +++ b/src/go/mongolib/explain/explain.go @@ -0,0 +1,46 @@ +package explain + +import ( + "fmt" + + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "github.com/percona/pmgo" + "gopkg.in/mgo.v2/bson" +) + +type explain struct { + session pmgo.SessionManager +} + +func New(session pmgo.SessionManager) *explain { + return &explain{ + session: session, + } +} + +func (e *explain) Explain(db string, query []byte) ([]byte, error) { + var err error + var eq proto.ExampleQuery + + err = bson.UnmarshalJSON(query, &eq) + if err != nil { + return nil, fmt.Errorf("explain: unable to decode query %s: %s", string(query), err) + } + + if db == "" { + db = eq.Db() + } + + var result proto.BsonD + err = e.session.DB(db).Run(eq.ExplainCmd(), &result) + if err != nil { + return nil, err + } + + resultJson, err := bson.MarshalJSON(result) + if err != nil { + return nil, fmt.Errorf("explain: unable to encode explain result of %s: %s", string(query), err) + } + + return resultJson, nil +} diff --git a/src/go/mongolib/explain/explain_test.go b/src/go/mongolib/explain/explain_test.go new file mode 100644 index 00000000..70ecfa92 --- /dev/null +++ b/src/go/mongolib/explain/explain_test.go @@ -0,0 +1,182 @@ +package explain + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "strings" + "testing" + + "github.com/Masterminds/semver" + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "github.com/percona/pmgo" + "gopkg.in/mgo.v2/bson" +) + +const ( + samples = "/src/go/tests/" +) + +type testVars struct { + RootPath string +} + +var vars testVars + +func TestMain(m *testing.M) { + var err error + if vars.RootPath, err = tutil.RootPath(); err != nil { + log.Printf("cannot get root path: %s", err.Error()) + os.Exit(1) + } + os.Exit(m.Run()) +} + +func TestExplain(t *testing.T) { + t.Parallel() + + dialer := pmgo.NewDialer() + dialInfo, err := pmgo.ParseURL("") + if err != nil { + t.Fatalf("cannot parse URL: %s", err) + } + + session, err := dialer.DialWithInfo(dialInfo) + if err != nil { + t.Fatalf("cannot dial to MongoDB: %s", err) + } + defer session.Close() + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + bi, err := session.BuildInfo() + if err != nil { + t.Fatalf("cannot get BuildInfo: %s", err) + } + + versions := []string{ + "2.6.12", + "3.0.15", + "3.2.16", + "3.4.7", + "3.5.11", + } + + samples := map[string]string{ + "aggregate": "Cannot explain cmd: aggregate", + "count": "", + "count_with_query": "", + "delete": "", + "delete_all": "", + "distinct": "", + "find_empty": "", + "find": "", + "find_with_sort": "", + "find_andrii": "", + "findandmodify": "", + "geonear": "Cannot explain cmd: geoNear", + "getmore": "", + "group": "", + "insert": "Cannot explain cmd: insert", + "mapreduce": "Cannot explain cmd: mapReduce", + "update": "", + "explain": "Cannot explain cmd: explain", + "eval": "Cannot explain cmd: eval", + } + + expectError := map[string]string{} + + // For versions < 3.0 explain is not supported + if ok, _ := Constraint("< 3.0", bi.Version); ok { + for _, v := range versions { + for sample := range samples { + expectError[sample+"_"+v] = "no such cmd: explain" + } + } + } else { + for _, v := range versions { + for sample, msg := range samples { + expectError[sample+"_"+v] = msg + } + } + + for _, v := range versions { + // For versions < 3.4 parsing "getmore" is not supported and returns error + if ok, _ := Constraint("< 3.4", v); ok { + expectError["getmore_"+v] = "Explain failed due to unknown command: getmore" + } + } + + // For versions >= 3.0, < 3.4 trying to explain "insert" returns different error + if ok, _ := Constraint(">= 3.0, < 3.4", bi.Version); ok { + for _, v := range versions { + expectError["insert_"+v] = "Only update and delete write ops can be explained" + } + } + + // Explaining `distinct` and `findAndModify` was introduced in MongoDB 3.2 + if ok, _ := Constraint(">= 3.0, < 3.2", bi.Version); ok { + for _, v := range versions { + expectError["distinct_"+v] = "Cannot explain cmd: distinct" + expectError["findandmodify_"+v] = "Cannot explain cmd: findAndModify" + } + } + } + + ex := New(session) + for _, file := range files { + t.Run(file.Name(), func(t *testing.T) { + eq := proto.ExampleQuery{} + err := tutil.LoadBson(dir+file.Name(), &eq) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) + } + query, err := bson.MarshalJSON(eq) + if err != nil { + t.Fatalf("cannot marshal json %s: %s", dir+file.Name(), err) + } + got, err := ex.Explain("", query) + expectErrMsg := expectError[file.Name()] + gotErrMsg := fmt.Sprintf("%v", err) + if gotErrMsg != expectErrMsg { + t.Fatalf("explain error should be '%s' but was '%s'", expectErrMsg, gotErrMsg) + } + + if err == nil { + result := proto.BsonD{} + err = bson.UnmarshalJSON(got, &result) + if err != nil { + t.Fatalf("cannot unmarshal json explain result: %s", err) + } + } + }) + } +} + +func Constraint(constraint, version string) (bool, error) { + // Drop everything after first dash. + // Version with dash is considered a pre-release + // but some MongoDB builds add additional information after dash + // even though it's not considered a pre-release but a release. + s := strings.SplitN(version, "-", 2) + version = s[0] + + // Create new version + v, err := semver.NewVersion(version) + if err != nil { + return false, err + } + + // Check if version matches constraint + constraints, err := semver.NewConstraint(constraint) + if err != nil { + return false, err + } + return constraints.Check(v), nil +} diff --git a/src/go/mongolib/fingerprinter/figerprinter.go b/src/go/mongolib/fingerprinter/figerprinter.go deleted file mode 100644 index 3a1c0de2..00000000 --- a/src/go/mongolib/fingerprinter/figerprinter.go +++ /dev/null @@ -1,115 +0,0 @@ -package fingerprinter - -import ( - "encoding/json" - "fmt" - "regexp" - "sort" - "strings" - - "github.com/percona/percona-toolkit/src/go/mongolib/util" -) - -var ( - MAX_DEPTH_LEVEL = 10 - DEFAULT_KEY_FILTERS = []string{"^shardVersion$", "^\\$"} -) - -type Fingerprinter interface { - Fingerprint(query map[string]interface{}) (string, error) -} - -type Fingerprint struct { - keyFilters []string -} - -func NewFingerprinter(keyFilters []string) *Fingerprint { - return &Fingerprint{ - keyFilters: keyFilters, - } -} - -// Query is the top level map query element -// Example for MongoDB 3.2+ -// "query" : { -// "find" : "col1", -// "filter" : { -// "s2" : { -// "$lt" : "54701", -// "$gte" : "73754" -// } -// }, -// "sort" : { -// "user_id" : 1 -// } -// } -func (f *Fingerprint) Fingerprint(query map[string]interface{}) (string, error) { - - realQuery, err := util.GetQueryField(query) - if err != nil { - // Try to encode doc.Query as json for prettiness - if buf, err := json.Marshal(realQuery); err == nil { - return "", fmt.Errorf("%v for query %s", err, string(buf)) - } - // If we cannot encode as json, return just the error message without the query - return "", err - } - retKeys := keys(realQuery, f.keyFilters) - - sort.Strings(retKeys) - - // if there is a sort clause in the query, we have to add all fields in the sort - // fields list that are not in the query keys list (retKeys) - if sortKeys, ok := query["sort"]; ok { - if sortKeysMap, ok := sortKeys.(map[string]interface{}); ok { - sortKeys := keys(sortKeysMap, f.keyFilters) - for _, sortKey := range sortKeys { - if !inSlice(sortKey, retKeys) { - retKeys = append(retKeys, sortKey) - } - } - } - } - - return strings.Join(retKeys, ","), nil -} - -func inSlice(str string, list []string) bool { - for _, v := range list { - if v == str { - return true - } - } - return false -} - -func keys(query map[string]interface{}, keyFilters []string) []string { - return getKeys(query, keyFilters, 0) -} - -func getKeys(query map[string]interface{}, keyFilters []string, level int) []string { - ks := []string{} - for key, value := range query { - if shouldSkipKey(key, keyFilters) { - continue - } - ks = append(ks, key) - if m, ok := value.(map[string]interface{}); ok { - level++ - if level <= MAX_DEPTH_LEVEL { - ks = append(ks, getKeys(m, keyFilters, level)...) - } - } - } - sort.Strings(ks) - return ks -} - -func shouldSkipKey(key string, keyFilters []string) bool { - for _, filter := range keyFilters { - if matched, _ := regexp.MatchString(filter, key); matched { - return true - } - } - return false -} diff --git a/src/go/mongolib/fingerprinter/fingerprinter.go b/src/go/mongolib/fingerprinter/fingerprinter.go new file mode 100644 index 00000000..e25536f6 --- /dev/null +++ b/src/go/mongolib/fingerprinter/fingerprinter.go @@ -0,0 +1,254 @@ +package fingerprinter + +import ( + "encoding/json" + "fmt" + "regexp" + "sort" + "strings" + + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "github.com/percona/percona-toolkit/src/go/mongolib/util" + "gopkg.in/mgo.v2/bson" +) + +var ( + MAX_DEPTH_LEVEL = 10 + DEFAULT_KEY_FILTERS = []string{"^shardVersion$"} +) + +type Fingerprint struct { + Namespace string + Operation string + Collection string + Database string + Keys string + Fingerprint string +} + +type Fingerprinter struct { + keyFilters []string +} + +func NewFingerprinter(keyFilters []string) *Fingerprinter { + return &Fingerprinter{ + keyFilters: keyFilters, + } +} + +func (f *Fingerprinter) Fingerprint(doc proto.SystemProfile) (Fingerprint, error) { + realQuery, err := util.GetQueryField(doc) + if err != nil { + // Try to encode doc.Query as json for prettiness + if buf, err := json.Marshal(realQuery); err == nil { + return Fingerprint{}, fmt.Errorf("%v for query %s", err, string(buf)) + } + // If we cannot encode as json, return just the error message without the query + return Fingerprint{}, err + } + retKeys := keys(realQuery, f.keyFilters) + + // Proper way to detect if protocol used is "op_msg" or "op_command" + // would be to look at "doc.Protocol" field, + // however MongoDB 3.0 doesn't have that field + // so we need to detect protocol by looking at actual data. + query := doc.Query + if doc.Command.Len() > 0 { + query = doc.Command + } + + // if there is a sort clause in the query, we have to add all fields in the sort + // fields list that are not in the query keys list (retKeys) + if sortKeys, ok := query.Map()["sort"]; ok { + if sortKeysMap, ok := sortKeys.(bson.M); ok { + sortKeys := keys(sortKeysMap, f.keyFilters) + retKeys = append(retKeys, sortKeys...) + } + } + + // if there is a orderby clause in the query, we have to add all fields in the sort + // fields list that are not in the query keys list (retKeys) + if sortKeys, ok := query.Map()["orderby"]; ok { + if sortKeysMap, ok := sortKeys.(bson.M); ok { + sortKeys := keys(sortKeysMap, f.keyFilters) + retKeys = append(retKeys, sortKeys...) + } + } + + // Extract operation, collection, database and namespace + op := "" + collection := "" + database := "" + ns := strings.SplitN(doc.Ns, ".", 2) + if len(ns) > 0 { + database = ns[0] + } + if len(ns) == 2 { + collection = ns[1] + } + switch doc.Op { + case "remove", "update": + op = doc.Op + case "insert": + op = doc.Op + retKeys = []string{} + case "query": + // EXPLAIN MongoDB 2.6: + // "query" : { + // "query" : { + // + // }, + // "$explain" : true + // }, + if _, ok := doc.Query.Map()["$explain"]; ok { + op = "explain" + database = "" + collection = "" + break + } + op = "find" + case "command": + if query.Len() == 0 { + break + } + // first key is operation type + op = query[0].Name + collection, _ = query[0].Value.(string) + switch op { + case "group": + retKeys = []string{} + if g, ok := query.Map()["group"]; ok { + if m, ok := g.(bson.M); ok { + if f, ok := m["key"]; ok { + if keysMap, ok := f.(bson.M); ok { + retKeys = append(retKeys, keys(keysMap, []string{})...) + } + } + if f, ok := m["cond"]; ok { + if keysMap, ok := f.(bson.M); ok { + retKeys = append(retKeys, keys(keysMap, []string{})...) + } + } + if f, ok := m["ns"]; ok { + if ns, ok := f.(string); ok { + collection = ns + } + } + } + } + case "distinct": + if key, ok := query.Map()["key"]; ok { + if k, ok := key.(string); ok { + retKeys = append(retKeys, k) + } + } + case "aggregate": + retKeys = []string{} + if v, ok := query.Map()["pipeline"]; ok { + retKeys = append(retKeys, keys(v, []string{})...) + } + case "geoNear": + retKeys = []string{} + case "explain": + database = "" + collection = "" + retKeys = []string{} + case "$eval": + op = "eval" + collection = "" + retKeys = []string{} + } + default: + op = doc.Op + retKeys = []string{} + } + + sort.Strings(retKeys) + retKeys = deduplicate(retKeys) + keys := strings.Join(retKeys, ",") + op = strings.ToUpper(op) + + parts := []string{} + if op != "" { + parts = append(parts, op) + } + if collection != "" { + parts = append(parts, collection) + } + if keys != "" { + parts = append(parts, keys) + } + + ns = []string{} + if database != "" { + ns = append(ns, database) + } + if collection != "" { + ns = append(ns, collection) + } + fp := Fingerprint{ + Operation: op, + Namespace: strings.Join(ns, "."), + Database: database, + Collection: collection, + Keys: keys, + Fingerprint: strings.Join(parts, " "), + } + + return fp, nil +} + +func keys(query interface{}, keyFilters []string) []string { + return getKeys(query, keyFilters, 0) +} + +func getKeys(query interface{}, keyFilters []string, level int) []string { + ks := []string{} + var q []bson.M + switch v := query.(type) { + case bson.M: + q = append(q, v) + case []bson.M: + q = v + default: + return ks + } + + if level <= MAX_DEPTH_LEVEL { + for i := range q { + for key, value := range q[i] { + if shouldSkipKey(key, keyFilters) { + continue + } + if matched, _ := regexp.MatchString("^\\$", key); !matched { + ks = append(ks, key) + } + + ks = append(ks, getKeys(value, keyFilters, level)...) + } + } + } + return ks +} + +func shouldSkipKey(key string, keyFilters []string) bool { + for _, filter := range keyFilters { + if matched, _ := regexp.MatchString(filter, key); matched { + return true + } + } + return false +} + +func deduplicate(s []string) (r []string) { + m := map[string]struct{}{} + + for _, v := range s { + if _, seen := m[v]; !seen { + r = append(r, v) + m[v] = struct{}{} + } + } + + return r +} diff --git a/src/go/mongolib/fingerprinter/fingerprinter_test.go b/src/go/mongolib/fingerprinter/fingerprinter_test.go new file mode 100644 index 00000000..004ceb1f --- /dev/null +++ b/src/go/mongolib/fingerprinter/fingerprinter_test.go @@ -0,0 +1,202 @@ +package fingerprinter + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "reflect" + "testing" + + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" + "gopkg.in/mgo.v2/bson" +) + +const ( + samples = "/src/go/tests/" +) + +type testVars struct { + RootPath string +} + +var vars testVars + +func TestMain(m *testing.M) { + var err error + if vars.RootPath, err = tutil.RootPath(); err != nil { + log.Printf("cannot get root path: %s", err.Error()) + os.Exit(1) + } + os.Exit(m.Run()) +} + +func ExampleFingerprint() { + doc := proto.SystemProfile{} + err := tutil.LoadBson(vars.RootPath+samples+"fingerprinter_doc.json", &doc) + if err != nil { + panic(err) + } + + fp := NewFingerprinter(DEFAULT_KEY_FILTERS) + got, err := fp.Fingerprint(doc) + if err != nil { + panic(err) + } + fmt.Println(got.Fingerprint) + // Output: FIND sbtest3 c,k,pad +} + +func TestFingerprint(t *testing.T) { + doc := proto.SystemProfile{} + doc.Ns = "db.feedback" + doc.Op = "query" + doc.Query = proto.BsonD{ + {"find", "feedback"}, + {"filter", bson.M{ + "tool": "Atlas", + "potId": "2c9180865ae33e85015af1cc29243dc5", + }}, + {"limit", 1}, + {"singleBatch", true}, + } + want := "FIND feedback potId,tool" + + fp := NewFingerprinter(nil) + got, err := fp.Fingerprint(doc) + if err != nil { + t.Error("Error in fingerprint") + } + + if got.Fingerprint != want { + t.Errorf("Invalid fingerprint. Got: %q, want %q", got.Fingerprint, want) + } +} + +func TestFingerprints(t *testing.T) { + t.Parallel() + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + expects := map[string]string{ + "aggregate_2.6.12": "AGGREGATE coll a", + "aggregate_3.0.15": "AGGREGATE coll a", + "aggregate_3.2.16": "AGGREGATE coll a", + "aggregate_3.4.7": "AGGREGATE coll a", + "aggregate_3.5.11": "AGGREGATE coll a", + "count_2.6.12": "COUNT coll", + "count_3.0.15": "COUNT coll", + "count_3.2.16": "COUNT coll", + "count_3.4.7": "COUNT coll", + "count_3.5.11": "COUNT coll", + "count_with_query_2.6.12": "COUNT coll a", + "count_with_query_3.0.15": "COUNT coll a", + "count_with_query_3.2.16": "COUNT coll a", + "count_with_query_3.4.7": "COUNT coll a", + "count_with_query_3.5.11": "COUNT coll a", + "delete_2.6.12": "REMOVE coll a,b", + "delete_3.0.15": "REMOVE coll a,b", + "delete_3.2.16": "REMOVE coll a,b", + "delete_3.4.7": "REMOVE coll a,b", + "delete_3.5.11": "REMOVE coll a,b", + "delete_all_2.6.12": "REMOVE coll a,b", + "delete_all_3.0.15": "REMOVE coll a,b", + "delete_all_3.2.16": "REMOVE coll a,b", + "delete_all_3.4.7": "REMOVE coll a,b", + "delete_all_3.5.11": "REMOVE coll a,b", + "distinct_2.6.12": "DISTINCT coll a,b", + "distinct_3.0.15": "DISTINCT coll a,b", + "distinct_3.2.16": "DISTINCT coll a,b", + "distinct_3.4.7": "DISTINCT coll a,b", + "distinct_3.5.11": "DISTINCT coll a,b", + "explain_2.6.12": "EXPLAIN", + "explain_3.0.15": "EXPLAIN", + "explain_3.2.16": "EXPLAIN", + "explain_3.4.7": "EXPLAIN", + "explain_3.5.11": "EXPLAIN", + "eval_2.6.12": "EVAL", + "eval_3.0.15": "EVAL", + "eval_3.2.16": "EVAL", + "eval_3.4.7": "EVAL", + "eval_3.5.11": "EVAL", + "find_empty_2.6.12": "FIND coll", + "find_empty_3.0.15": "FIND coll", + "find_empty_3.2.16": "FIND coll", + "find_empty_3.4.7": "FIND coll", + "find_empty_3.5.11": "FIND coll", + "find_2.6.12": "FIND coll k", + "find_3.0.15": "FIND coll k", + "find_3.2.16": "FIND coll k", + "find_3.4.7": "FIND coll k", + "find_3.5.11": "FIND coll k", + "find_andrii_2.6.12": "FIND coll c,k,pad", + "find_andrii_3.0.15": "FIND coll c,k,pad", + "find_andrii_3.2.16": "FIND coll c,k,pad", + "find_andrii_3.4.7": "FIND coll c,k,pad", + "find_andrii_3.5.11": "FIND coll c,k,pad", + "find_with_sort_2.6.12": "FIND coll b,c", + "find_with_sort_3.0.15": "FIND coll b,c", + "find_with_sort_3.2.16": "FIND coll b,c", + "find_with_sort_3.4.7": "FIND coll b,c", + "find_with_sort_3.5.11": "FIND coll b,c", + "findandmodify_2.6.12": "FINDANDMODIFY coll a", + "findandmodify_3.0.15": "FINDANDMODIFY coll a", + "findandmodify_3.2.16": "FINDANDMODIFY coll a", + "findandmodify_3.4.7": "FINDANDMODIFY coll a", + "findandmodify_3.5.11": "FINDANDMODIFY coll a", + "geonear_2.6.12": "GEONEAR coll", + "geonear_3.0.15": "GEONEAR coll", + "geonear_3.2.16": "GEONEAR coll", + "geonear_3.4.7": "GEONEAR coll", + "geonear_3.5.11": "GEONEAR coll", + "getmore_2.6.12": "GETMORE coll", + "getmore_3.0.15": "GETMORE coll", + "getmore_3.2.16": "GETMORE coll", + "getmore_3.4.7": "GETMORE coll", + "getmore_3.5.11": "GETMORE coll", + "group_2.6.12": "GROUP coll a,b", + "group_3.0.15": "GROUP coll a,b", + "group_3.2.16": "GROUP coll a,b", + "group_3.4.7": "GROUP coll a,b", + "group_3.5.11": "GROUP coll a,b", + "insert_2.6.12": "INSERT coll", + "insert_3.0.15": "INSERT coll", + "insert_3.2.16": "INSERT coll", + "insert_3.4.7": "INSERT coll", + "insert_3.5.11": "INSERT coll", + "mapreduce_2.6.12": "MAPREDUCE coll a", + "mapreduce_3.0.15": "MAPREDUCE coll a", + "mapreduce_3.2.16": "MAPREDUCE coll a", + "mapreduce_3.4.7": "MAPREDUCE coll a", + "mapreduce_3.5.11": "MAPREDUCE coll a", + "update_2.6.12": "UPDATE coll a", + "update_3.0.15": "UPDATE coll a", + "update_3.2.16": "UPDATE coll a", + "update_3.4.7": "UPDATE coll a", + "update_3.5.11": "UPDATE coll a", + } + + for _, file := range files { + t.Run(file.Name(), func(t *testing.T) { + doc := proto.SystemProfile{} + err = tutil.LoadBson(dir+file.Name(), &doc) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) + } + fp := NewFingerprinter(DEFAULT_KEY_FILTERS) + got, err := fp.Fingerprint(doc) + if err != nil { + t.Errorf("cannot create fingerprint: %s", err) + } + expect := expects[file.Name()] + if !reflect.DeepEqual(got.Fingerprint, expect) { + t.Errorf("fp.Fingerprint(doc) = %s, want %s", got.Fingerprint, expect) + } + }) + } +} diff --git a/src/go/mongolib/profiler/profiler.go b/src/go/mongolib/profiler/profiler.go index f920a28c..be03d4cb 100644 --- a/src/go/mongolib/profiler/profiler.go +++ b/src/go/mongolib/profiler/profiler.go @@ -19,6 +19,7 @@ type Profiler interface { GetLastError() error QueriesChan() chan stats.Queries TimeoutsChan() <-chan time.Time + FlushQueries() Start() Stop() } @@ -94,6 +95,8 @@ func (p *Profile) Stop() { } func (p *Profile) TimeoutsChan() <-chan time.Time { + p.lock.Lock() + defer p.lock.Unlock() if p.timeoutsChan == nil { p.timeoutsChan = make(chan time.Time) } @@ -108,8 +111,7 @@ MAIN_GETDATA_LOOP: for { select { case <-p.ticker: - p.queriesChan <- p.stats.Queries() - p.stats.Reset() + p.FlushQueries() case <-p.stopChan: // Close the iterator to break the loop on getDocs p.iterator.Close() @@ -120,6 +122,9 @@ MAIN_GETDATA_LOOP: } func (p *Profile) getDocs() { + defer p.Stop() + defer p.FlushQueries() + var doc proto.SystemProfile for p.iterator.Next(&doc) || p.iterator.Timeout() { @@ -139,10 +144,11 @@ func (p *Profile) getDocs() { if !valid { continue } - if len(doc.Query) > 0 { - p.stats.Add(doc) - } + p.stats.Add(doc) } - p.queriesChan <- p.stats.Queries() - p.Stop() +} + +func (p *Profile) FlushQueries() { + p.queriesChan <- p.stats.Queries() + p.stats.Reset() } diff --git a/src/go/mongolib/profiler/profiler_test.go b/src/go/mongolib/profiler/profiler_test.go index c3289396..670a9e5c 100644 --- a/src/go/mongolib/profiler/profiler_test.go +++ b/src/go/mongolib/profiler/profiler_test.go @@ -70,14 +70,11 @@ func TestRegularIterator(t *testing.T) { lastSeen, _ := time.Parse(time.RFC3339Nano, "2017-04-01T23:01:20.214+00:00") want := stats.Queries{ { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "95575e896c2830043dc333cb8ee61339", + Namespace: "samples.col1", + Operation: "FIND", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", + Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, TableScan: false, @@ -89,6 +86,7 @@ func TestRegularIterator(t *testing.T) { }, } prof.Start() + defer prof.Stop() select { case queries := <-prof.QueriesChan(): if !reflect.DeepEqual(queries, want) { @@ -130,14 +128,11 @@ func TestIteratorTimeout(t *testing.T) { lastSeen, _ := time.Parse(time.RFC3339Nano, "2017-04-01T23:01:19.914+00:00") want := stats.Queries{ { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "95575e896c2830043dc333cb8ee61339", + Namespace: "samples.col1", + Operation: "FIND", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", + Fingerprint: "FIND col1 find", FirstSeen: firstSeen, LastSeen: lastSeen, TableScan: false, @@ -150,6 +145,7 @@ func TestIteratorTimeout(t *testing.T) { } prof.Start() + defer prof.Stop() gotTimeout := false // Get a timeout @@ -174,8 +170,6 @@ func TestIteratorTimeout(t *testing.T) { case <-time.After(2 * time.Second): t.Error("Didn't get any query after 2 seconds") } - - prof.Stop() } func TestTailIterator(t *testing.T) { @@ -214,14 +208,11 @@ func TestTailIterator(t *testing.T) { want := stats.Queries{ { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "95575e896c2830043dc333cb8ee61339", + Namespace: "samples.col1", + Operation: "FIND", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", + Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:20.214+00:00"), LastSeen: parseDate("2017-04-01T23:01:20.214+00:00"), TableScan: false, @@ -232,14 +223,11 @@ func TestTailIterator(t *testing.T) { ResponseLength: []float64{1.06123e+06}, }, { - ID: "c6466139b21c392acd0699e863b50d81", - Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{ - "find": "col1", - "shardVersion": []interface{}{float64(0), "000000000000000000000000"}, - }, - Fingerprint: "find", + ID: "95575e896c2830043dc333cb8ee61339", + Namespace: "samples.col1", + Operation: "FIND", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", + Fingerprint: "FIND col1 find", FirstSeen: parseDate("2017-04-01T23:01:19.914+00:00"), LastSeen: parseDate("2017-04-01T23:01:19.914+00:00"), TableScan: false, @@ -251,6 +239,7 @@ func TestTailIterator(t *testing.T) { }, } prof.Start() + defer prof.Stop() index := 0 // Since the mocked iterator has a Sleep(1500 ms) between Next methods calls, // we are going to have two ticker ticks and on every tick it will return one document. @@ -270,13 +259,13 @@ func TestCalcStats(t *testing.T) { defer ctrl.Finish() docs := []proto.SystemProfile{} - err := tutil.LoadJson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) + err := tutil.LoadBson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) if err != nil { t.Fatalf("cannot load samples: %s", err.Error()) } want := []stats.QueryStats{} - err = tutil.LoadJson(vars.RootPath+samples+"profiler_docs_stats.want.json", &want) + err = tutil.LoadBson(vars.RootPath+samples+"profiler_docs_stats.want.json", &want) if err != nil { t.Fatalf("cannot load expected results: %s", err.Error()) } @@ -300,6 +289,8 @@ func TestCalcStats(t *testing.T) { prof := NewProfiler(iter, filters, nil, s) prof.Start() + defer prof.Stop() + select { case queries := <-prof.QueriesChan(): s := queries.CalcQueriesStats(1) @@ -319,13 +310,13 @@ func TestCalcTotalStats(t *testing.T) { defer ctrl.Finish() docs := []proto.SystemProfile{} - err := tutil.LoadJson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) + err := tutil.LoadBson(vars.RootPath+samples+"profiler_docs_stats.json", &docs) if err != nil { t.Fatalf("cannot load samples: %s", err.Error()) } want := stats.QueryStats{} - err = tutil.LoadJson(vars.RootPath+samples+"profiler_docs_total_stats.want.json", &want) + err = tutil.LoadBson(vars.RootPath+samples+"profiler_docs_total_stats.want.json", &want) if err != nil && !tutil.ShouldUpdateSamples() { t.Fatalf("cannot load expected results: %s", err.Error()) } @@ -349,6 +340,7 @@ func TestCalcTotalStats(t *testing.T) { prof := NewProfiler(iter, filters, nil, s) prof.Start() + defer prof.Stop() select { case queries := <-prof.QueriesChan(): s := queries.CalcTotalQueriesStats(1) diff --git a/src/go/mongolib/proto/bson.go b/src/go/mongolib/proto/bson.go new file mode 100644 index 00000000..b8664a72 --- /dev/null +++ b/src/go/mongolib/proto/bson.go @@ -0,0 +1,167 @@ +package proto + +import ( + "bytes" + "encoding/json" + "fmt" + "math" + + "gopkg.in/mgo.v2/bson" +) + +type BsonD bson.D + +func (d *BsonD) UnmarshalJSON(data []byte) error { + dec := json.NewDecoder(bytes.NewReader(data)) + + t, err := dec.Token() + if err != nil { + return err + } + if t != json.Delim('{') { + return fmt.Errorf("expected { but got %s", t) + } + for { + t, err := dec.Token() + if err != nil { + return err + } + + // Might be empty object + if t == json.Delim('}') { + return nil + } + + key, ok := t.(string) + if !ok { + return fmt.Errorf("expected key to be a string but got %s", t) + } + + de := bson.DocElem{} + de.Name = key + + if !dec.More() { + return fmt.Errorf("missing value for key %s", key) + } + + var raw json.RawMessage + err = dec.Decode(&raw) + if err != nil { + return err + } + + var v BsonD + err = bson.UnmarshalJSON(raw, &v) + if err != nil { + var v []BsonD + err = bson.UnmarshalJSON(raw, &v) + if err != nil { + var v interface{} + err = bson.UnmarshalJSON(raw, &v) + if err != nil { + return err + } else { + de.Value = v + } + } else { + de.Value = v + } + } else { + de.Value = v + } + + *d = append(*d, de) + if !dec.More() { + break + } + } + + t, err = dec.Token() + if err != nil { + return err + } + if t != json.Delim('}') { + return fmt.Errorf("expect delimeter %s but got %s", json.Delim('}'), t) + } + + return nil +} + +func (d BsonD) MarshalJSON() ([]byte, error) { + var b bytes.Buffer + + b.WriteByte('{') + + for i, v := range d { + if i > 0 { + b.WriteByte(',') + } + + // marshal key + key, err := bson.MarshalJSON(v.Name) + if err != nil { + return nil, err + } + b.Write(key) + b.WriteByte(':') + + var val []byte + if value, ok := v.Value.(float64); ok && math.IsInf(value, 0) { + if math.IsInf(value, 1) { + val = []byte("Infinity") + } else { + val = []byte("-Infinity") + } + + // below is wrong, but I'm later unable to Unmarshal Infinity, + // so we turn it into string for now + val = append([]byte(`"`), val...) + val = append(val, '"') + } else { + // marshal value + val, err = bson.MarshalJSON(v.Value) + if err != nil { + return nil, err + } + } + b.Write(val) + } + + b.WriteByte('}') + + return b.Bytes(), nil +} + +func (d BsonD) Len() int { + return len(d) +} + +// Map returns a map out of the ordered element name/value pairs in d. +func (d BsonD) Map() (m bson.M) { + m = make(bson.M, len(d)) + for _, item := range d { + switch v := item.Value.(type) { + case BsonD: + m[item.Name] = v.Map() + case []BsonD: + el := []bson.M{} + for i := range v { + el = append(el, v[i].Map()) + } + m[item.Name] = el + case []interface{}: + // mgo/bson doesn't expose UnmarshalBSON interface + // so we can't create custom bson.Unmarshal() + el := []bson.M{} + for i := range v { + if b, ok := v[i].(BsonD); ok { + el = append(el, b.Map()) + } + } + m[item.Name] = el + default: + m[item.Name] = item.Value + } + } + return m +} diff --git a/src/go/mongolib/proto/main_test.go b/src/go/mongolib/proto/main_test.go index c6d96154..45a00723 100644 --- a/src/go/mongolib/proto/main_test.go +++ b/src/go/mongolib/proto/main_test.go @@ -6,8 +6,6 @@ import ( "os" "testing" - "github.com/percona/percona-toolkit/src/go/mongolib/proto" - mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/dbtest" @@ -36,12 +34,11 @@ func TestMain(m *testing.M) { os.Exit(retCode) } -func ExampleServerStatus() { - ss := proto.ServerStatus{} - if err := session.DB("admin").Run(bson.D{{"serverStatus", 1}, {"recordStats", 1}}, &ss); err != nil { +func ExamplePing() { + ss := map[string]interface{}{} + if err := session.DB("admin").Run(bson.D{{"ping", 1}}, &ss); err != nil { panic(err) } fmt.Printf("%+v", ss) - // Output: - + // Output: map[ok:1] } diff --git a/src/go/mongolib/proto/oplog.go b/src/go/mongolib/proto/oplog.go index b0cd2dab..371f13cd 100644 --- a/src/go/mongolib/proto/oplog.go +++ b/src/go/mongolib/proto/oplog.go @@ -41,11 +41,13 @@ func (s OpLogs) Less(i, j int) bool { } type OplogRow struct { - H int64 `bson:"h"` - V int64 `bson:"v"` - Op string `bson:"op"` - O bson.M `bson:"o"` - Ts int64 `bson:"ts"` + Timestamp int64 `bson:"ts,omitempty"` + HistoryId int64 `bson:"h,omitempty"` + Version int64 `bson:"v,omitempty"` + Operation string `bson:"op,omitempty"` + Namespace string `bson:"ns,omitempty"` + Object bson.D `bson:"o,omitempty"` + Query bson.D `bson:"o2,omitempty"` } type OplogColStats struct { diff --git a/src/go/mongolib/proto/replconfig.go b/src/go/mongolib/proto/replconfig.go new file mode 100644 index 00000000..8ce984d2 --- /dev/null +++ b/src/go/mongolib/proto/replconfig.go @@ -0,0 +1,50 @@ +package proto + +import ( + "gopkg.in/mgo.v2/bson" +) + +type ReplicaSetConfigTags map[string]string +type GetLastErrorModes map[string]*ReplicaSetConfigTags + +// https://docs.mongodb.com/v3.2/reference/command/getLastError/#dbcmd.getLastError +type GetLastErrorDefaults struct { + Journal bool `bson:"j,omitempty"` // If true, wait for the next journal commit before returning, rather than waiting for a full disk flush. + WriteConcern int64 `bson:"w,omitempty"` // When running with replication, this is the number of servers to replicate to before returning. + WTimeout int64 `bson:"wtimeout,omitempty"` // Optional. Milliseconds. Specify a value in milliseconds to control how long to wait for write propagation to complete. +} + +// https://docs.mongodb.com/v3.2/reference/replica-configuration/#rsconf.members +type ReplicaSetConfigMember struct { + ID int64 `bson:"_id,omitempty"` // An integer identifier of every member in the replica set. + Host string `bson:"host,omitempty"` // The hostname and, if specified, the port number, of the set member. + ArbiterOnly bool `bson:"arbiterOnly,omitempty"` // A boolean that identifies an arbiter. A value of true indicates that the member is an arbiter. + BuildIndexes bool `bson:"buildIndexes,omitempty"` // A boolean that indicates whether the mongod builds indexes on this member. + Hidden bool `bson:"hidden,omitempty"` // When this value is true, the replica set hides this instance and does not include the member in the output of db.isMaster() or isMaster. + Priority int64 `bson:"priority,omitempty"` // A number that indicates the relative eligibility of a member to become a primary. + Tags *ReplicaSetConfigTags `bson:"tags,omitempty"` // A tag set document containing mappings of arbitrary keys and values. + SlaveDelay int64 `bson:"slaveDelay,omitempty"` // The number of seconds “behind” the primary that this replica set member should “lag”. + Votes int64 `bson:"votes,omitempty"` // The number of votes a server will cast in a replica set election. +} + +// https://docs.mongodb.com/v3.2/reference/replica-configuration/#rsconf.settings +type ReplicaSetConfigSettings struct { + ChainingAllowed bool `bson:"chainingAllowed,omitempty"` // When chainingAllowed is true, the replica set allows secondary members to replicate from other secondary members. + HeartbeatTimeoutSecs int64 `bson:"heartbeatTimeoutSecs,omitempty"` // Number of seconds that the replica set members wait for a successful heartbeat from each other. + HeartbeatIntervalMillis int64 `bson:"heartbeatIntervalMillis,omitempty"` // The frequency in milliseconds of the heartbeats. + ElectionTimeoutMillis int64 `bson:"electionTimeoutMillis,omitempty"` // The time limit in milliseconds for detecting when a replica set’s primary is unreachable. + GetLastErrorDefaults *GetLastErrorDefaults `bson:"getLastErrorDefaults,omitempty"` // A document that specifies the write concern for the replica set. + GetLastErrorModes *GetLastErrorModes `bson:"getLastErrorModes,omitempty"` // A document used to define an extended write concern through the use of members[n].tags. + ReplicaSetId *bson.ObjectId `bson:"replicaSetId,omitempty"` // Replset Id (ObjectId) +} + +type ReplicaSetConfig struct { + Config struct { + ID string `bson:"_id,omitempty"` // The name of the replica set. Once set, you cannot change the name of a replica set. + ProtocolVersion int64 `bson:"protocolVersion,omitempty"` // By default, new replica sets in MongoDB 3.2 use protocolVersion: 1. Previous versions of MongoDB use version 0. + Version int64 `bson:"version,omitempty"` // An incrementing number used to distinguish revisions of the replica set configuration object from previous iterations. + Members []*ReplicaSetConfigMember `bson:"members,omitempty"` // An array of member configuration documents, one for each member of the replica set. + Settings *ReplicaSetConfigSettings `bson:"settings,omitempty"` // A document that contains configuration options that apply to the whole replica set. + } `bson:"config,omitempty"` // https://docs.mongodb.com/v3.2/reference/replica-configuration/#replica-set-configuration-fields + Ok int64 `bson:"ok,omitempty"` +} diff --git a/src/go/mongolib/proto/system.profile.go b/src/go/mongolib/proto/system.profile.go index 3bb4494d..979d7b43 100644 --- a/src/go/mongolib/proto/system.profile.go +++ b/src/go/mongolib/proto/system.profile.go @@ -1,12 +1,20 @@ package proto -import "time" +import ( + "strings" + "time" + "gopkg.in/mgo.v2/bson" +) + +// docsExamined is renamed from nscannedObjects in 3.2.0 +// https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.docsExamined type SystemProfile struct { AllUsers []interface{} `bson:"allUsers"` Client string `bson:"client"` CursorExhausted bool `bson:"cursorExhausted"` DocsExamined int `bson:"docsExamined"` + NscannedObjects int `bson:"nscannedObjects"` ExecStats struct { Advanced int `bson:"advanced"` ExecutionTimeMillisEstimate int `bson:"executionTimeMillisEstimate"` @@ -65,15 +73,205 @@ type SystemProfile struct { } `bson:"acquireCount"` } `bson:"MMAPV1Journal"` } `bson:"locks"` - Millis int `bson:"millis"` - Nreturned int `bson:"nreturned"` - Ns string `bson:"ns"` - NumYield int `bson:"numYield"` - Op string `bson:"op"` - Protocol string `bson:"protocol"` - Query map[string]interface{} `bson:"query"` - ResponseLength int `bson:"responseLength"` - Ts time.Time `bson:"ts"` - User string `bson:"user"` - WriteConflicts int `bson:"writeConflicts"` + Millis int `bson:"millis"` + Nreturned int `bson:"nreturned"` + Ns string `bson:"ns"` + NumYield int `bson:"numYield"` + Op string `bson:"op"` + Protocol string `bson:"protocol"` + Query BsonD `bson:"query"` + UpdateObj BsonD `bson:"updateobj"` + Command BsonD `bson:"command"` + OriginatingCommand BsonD `bson:"originatingCommand"` + ResponseLength int `bson:"responseLength"` + Ts time.Time `bson:"ts"` + User string `bson:"user"` + WriteConflicts int `bson:"writeConflicts"` +} + +func NewExampleQuery(doc SystemProfile) ExampleQuery { + return ExampleQuery{ + Ns: doc.Ns, + Op: doc.Op, + Query: doc.Query, + Command: doc.Command, + OriginatingCommand: doc.OriginatingCommand, + UpdateObj: doc.UpdateObj, + } +} + +// ExampleQuery is a subset of SystemProfile +type ExampleQuery struct { + Ns string `bson:"ns" json:"ns"` + Op string `bson:"op" json:"op"` + Query BsonD `bson:"query,omitempty" json:"query,omitempty"` + Command BsonD `bson:"command,omitempty" json:"command,omitempty"` + OriginatingCommand BsonD `bson:"originatingCommand,omitempty" json:"originatingCommand,omitempty"` + UpdateObj BsonD `bson:"updateobj,omitempty" json:"updateobj,omitempty"` +} + +func (self ExampleQuery) Db() string { + ns := strings.SplitN(self.Ns, ".", 2) + if len(ns) > 0 { + return ns[0] + } + return "" +} + +func (self ExampleQuery) ExplainCmd() bson.D { + cmd := self.Command + + switch self.Op { + case "query": + if cmd.Len() == 0 { + cmd = self.Query + } + + // MongoDB 2.6: + // + // "query" : { + // "query" : { + // + // }, + // "$explain" : true + // }, + if _, ok := cmd.Map()["$explain"]; ok { + cmd = BsonD{ + {"explain", ""}, + } + break + } + + if cmd.Len() == 0 || cmd[0].Name != "find" { + var filter interface{} + if cmd.Len() > 0 && cmd[0].Name == "query" { + filter = cmd[0].Value + } else { + filter = cmd + } + + coll := "" + s := strings.SplitN(self.Ns, ".", 2) + if len(s) == 2 { + coll = s[1] + } + + cmd = BsonD{ + {"find", coll}, + {"filter", filter}, + } + } else { + for i := range cmd { + // drop $db param as it is not supported in MongoDB 3.0 + if cmd[i].Name == "$db" { + if len(cmd)-1 == i { + cmd = cmd[:i] + } else { + cmd = append(cmd[:i], cmd[i+1:]...) + } + break + } + } + } + case "update": + s := strings.SplitN(self.Ns, ".", 2) + coll := "" + if len(s) == 2 { + coll = s[1] + } + if cmd.Len() == 0 { + cmd = BsonD{ + {Name: "q", Value: self.Query}, + {Name: "u", Value: self.UpdateObj}, + } + } + cmd = BsonD{ + {Name: "update", Value: coll}, + {Name: "updates", Value: []interface{}{cmd}}, + } + case "remove": + s := strings.SplitN(self.Ns, ".", 2) + coll := "" + if len(s) == 2 { + coll = s[1] + } + if cmd.Len() == 0 { + cmd = BsonD{ + {Name: "q", Value: self.Query}, + // we can't determine if limit was 1 or 0 so we assume 0 + {Name: "limit", Value: 0}, + } + } + cmd = BsonD{ + {Name: "delete", Value: coll}, + {Name: "deletes", Value: []interface{}{cmd}}, + } + case "insert": + if cmd.Len() == 0 { + cmd = self.Query + } + if cmd.Len() == 0 || cmd[0].Name != "insert" { + coll := "" + s := strings.SplitN(self.Ns, ".", 2) + if len(s) == 2 { + coll = s[1] + } + + cmd = BsonD{ + {"insert", coll}, + } + } + case "getmore": + if self.OriginatingCommand.Len() > 0 { + cmd = self.OriginatingCommand + for i := range cmd { + // drop $db param as it is not supported in MongoDB 3.0 + if cmd[i].Name == "$db" { + if len(cmd)-1 == i { + cmd = cmd[:i] + } else { + cmd = append(cmd[:i], cmd[i+1:]...) + } + break + } + } + } else { + cmd = BsonD{ + {Name: "getmore", Value: ""}, + } + } + case "command": + if cmd.Len() == 0 || cmd[0].Name != "group" { + break + } + + if group, ok := cmd[0].Value.(BsonD); ok { + for i := range group { + // for MongoDB <= 3.2 + // "$reduce" : function () {} + // It is then Unmarshaled as empty value, so in essence not working + // + // for MongoDB >= 3.4 + // "$reduce" : { + // "code" : "function () {}" + // } + // It is then properly Unmarshaled but then explain fails with "not code" + // + // The $reduce function shouldn't affect explain execution plan (e.g. what indexes are picked) + // so we ignore it for now until we find better way to handle this issue + if group[i].Name == "$reduce" { + group[i].Value = "{}" + cmd[0].Value = group + break + } + } + } + } + + return bson.D{ + { + Name: "explain", + Value: cmd, + }, + } } diff --git a/src/go/mongolib/stats/fingerprinter.go b/src/go/mongolib/stats/fingerprinter.go new file mode 100644 index 00000000..a47dd69f --- /dev/null +++ b/src/go/mongolib/stats/fingerprinter.go @@ -0,0 +1,10 @@ +package stats + +import ( + "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" + "github.com/percona/percona-toolkit/src/go/mongolib/proto" +) + +type Fingerprinter interface { + Fingerprint(doc proto.SystemProfile) (fingerprinter.Fingerprint, error) +} diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index e7c38b84..74a51911 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -2,15 +2,14 @@ package stats import ( "crypto/md5" - "encoding/json" "fmt" + "sort" "sync" "time" "github.com/montanaflynn/stats" - "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/proto" - "github.com/percona/percona-toolkit/src/go/mongolib/util" + "gopkg.in/mgo.v2/bson" ) type StatsError struct { @@ -30,10 +29,9 @@ func (e *StatsError) Parent() error { } type StatsFingerprintError StatsError -type StatsGetQueryFieldError StatsError -// New creates new instance of stats with given fingerprinter -func New(fingerprinter fingerprinter.Fingerprinter) *Stats { +// New creates new instance of stats with given Fingerprinter +func New(fingerprinter Fingerprinter) *Stats { s := &Stats{ fingerprinter: fingerprinter, } @@ -45,7 +43,7 @@ func New(fingerprinter fingerprinter.Fingerprinter) *Stats { // Stats is a collection of MongoDB statistics type Stats struct { // dependencies - fingerprinter fingerprinter.Fingerprinter + fingerprinter Fingerprinter // internal queryInfoAndCounters map[GroupKey]*QueryInfoAndCounters @@ -62,7 +60,7 @@ func (s *Stats) Reset() { // Add adds proto.SystemProfile to the collection of statistics func (s *Stats) Add(doc proto.SystemProfile) error { - fp, err := s.fingerprinter.Fingerprint(doc.Query) + fp, err := s.fingerprinter.Fingerprint(doc) if err != nil { return &StatsFingerprintError{err} } @@ -70,35 +68,41 @@ func (s *Stats) Add(doc proto.SystemProfile) error { var ok bool key := GroupKey{ - Operation: doc.Op, - Fingerprint: fp, - Namespace: doc.Ns, + Operation: fp.Operation, + Fingerprint: fp.Fingerprint, + Namespace: fp.Namespace, } if qiac, ok = s.getQueryInfoAndCounters(key); !ok { - realQuery, err := util.GetQueryField(doc.Query) + query := proto.NewExampleQuery(doc) + queryBson, err := bson.MarshalJSON(query) if err != nil { - return &StatsGetQueryFieldError{err} + return err } qiac = &QueryInfoAndCounters{ ID: fmt.Sprintf("%x", md5.Sum([]byte(fmt.Sprintf("%s", key)))), - Operation: doc.Op, - Fingerprint: fp, - Namespace: doc.Ns, + Operation: fp.Operation, + Fingerprint: fp.Fingerprint, + Namespace: fp.Namespace, TableScan: false, - Query: realQuery, + Query: string(queryBson), } s.setQueryInfoAndCounters(key, qiac) } qiac.Count++ - qiac.NScanned = append(qiac.NScanned, float64(doc.DocsExamined)) + // docsExamined is renamed from nscannedObjects in 3.2.0. + // https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.docsExamined + if doc.NscannedObjects > 0 { + qiac.NScanned = append(qiac.NScanned, float64(doc.NscannedObjects)) + } else { + qiac.NScanned = append(qiac.NScanned, float64(doc.DocsExamined)) + } qiac.NReturned = append(qiac.NReturned, float64(doc.Nreturned)) qiac.QueryTime = append(qiac.QueryTime, float64(doc.Millis)) qiac.ResponseLength = append(qiac.ResponseLength, float64(doc.ResponseLength)) - var zeroTime time.Time - if qiac.FirstSeen == zeroTime || qiac.FirstSeen.After(doc.Ts) { + if qiac.FirstSeen.IsZero() || qiac.FirstSeen.After(doc.Ts) { qiac.FirstSeen = doc.Ts } - if qiac.LastSeen == zeroTime || qiac.LastSeen.Before(doc.Ts) { + if qiac.LastSeen.IsZero() || qiac.LastSeen.Before(doc.Ts) { qiac.LastSeen = doc.Ts } @@ -110,9 +114,15 @@ func (s *Stats) Queries() Queries { s.RLock() defer s.RUnlock() + keys := GroupKeys{} + for key := range s.queryInfoAndCounters { + keys = append(keys, key) + } + sort.Sort(keys) + queries := []QueryInfoAndCounters{} - for _, v := range s.queryInfoAndCounters { - queries = append(queries, *v) + for _, key := range keys { + queries = append(queries, *s.queryInfoAndCounters[key]) } return queries } @@ -162,7 +172,7 @@ type QueryInfoAndCounters struct { ID string Namespace string Operation string - Query map[string]interface{} + Query string Fingerprint string FirstSeen time.Time LastSeen time.Time @@ -184,10 +194,20 @@ func (a Times) Len() int { return len(a) } func (a Times) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a Times) Less(i, j int) bool { return a[i].Before(a[j]) } +type GroupKeys []GroupKey + +func (a GroupKeys) Len() int { return len(a) } +func (a GroupKeys) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a GroupKeys) Less(i, j int) bool { return a[i].String() < a[j].String() } + type GroupKey struct { Operation string - Fingerprint string Namespace string + Fingerprint string +} + +func (g GroupKey) String() string { + return g.Operation + g.Namespace + g.Fingerprint } type totalCounters struct { @@ -229,12 +249,11 @@ type Statistics struct { } func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters) QueryStats { - buf, _ := json.Marshal(query.Query) queryStats := QueryStats{ Count: query.Count, ID: query.ID, Operation: query.Operation, - Query: string(buf), + Query: query.Query, Fingerprint: query.Fingerprint, Scanned: calcStats(query.NScanned), Returned: calcStats(query.NReturned), @@ -255,7 +274,7 @@ func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters) queryStats.QueryTime.Pct = queryStats.QueryTime.Total * 100 / tc.QueryTime } if tc.Bytes > 0 { - queryStats.ResponseLength.Pct = queryStats.ResponseLength.Total / tc.Bytes + queryStats.ResponseLength.Pct = queryStats.ResponseLength.Total * 100 / tc.Bytes } if queryStats.Returned.Total > 0 { queryStats.Ratio = queryStats.Scanned.Total / queryStats.Returned.Total @@ -267,6 +286,7 @@ func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters) func aggregateCounters(queries []QueryInfoAndCounters) QueryInfoAndCounters { qt := QueryInfoAndCounters{} for _, query := range queries { + qt.Count += query.Count qt.NScanned = append(qt.NScanned, query.NScanned...) qt.NReturned = append(qt.NReturned, query.NReturned...) qt.QueryTime = append(qt.QueryTime, query.QueryTime...) diff --git a/src/go/mongolib/stats/stats_test.go b/src/go/mongolib/stats/stats_test.go index d1e4b3f8..98af2347 100644 --- a/src/go/mongolib/stats/stats_test.go +++ b/src/go/mongolib/stats/stats_test.go @@ -1,15 +1,22 @@ package stats import ( + "bytes" + "fmt" + "io/ioutil" + "log" + "os" + "reflect" + "sort" + "strings" + "testing" + "text/template" + "time" + "github.com/golang/mock/gomock" "github.com/percona/percona-toolkit/src/go/lib/tutil" "github.com/percona/percona-toolkit/src/go/mongolib/fingerprinter" "github.com/percona/percona-toolkit/src/go/mongolib/proto" - "log" - "os" - "reflect" - "testing" - "time" ) const ( @@ -138,11 +145,11 @@ func TestStats(t *testing.T) { t.Errorf("Error processing doc: %s\n", err.Error()) } statsVal := QueryInfoAndCounters{ - ID: "84e09ef6a3dc35f472df05fa98eee7d3", + ID: "d7088d6b50551d1f2f5f34b006c0140d", Namespace: "samples.col1", - Operation: "query", - Query: map[string]interface{}{"s2": map[string]interface{}{"$gte": "41991", "$lt": "33754"}}, - Fingerprint: "s2", + Operation: "FIND", + Query: "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", + Fingerprint: "FIND col1 s2", FirstSeen: parseDate("2017-04-10T13:15:53.532-03:00"), LastSeen: parseDate("2017-04-10T13:15:53.532-03:00"), TableScan: false, @@ -164,3 +171,292 @@ func TestStats(t *testing.T) { t.Errorf("Error \nGot:%#v\nWant: %#v\n", got, want) } } + +func TestStatsSingle(t *testing.T) { + t.Parallel() + + dirExpect := vars.RootPath + samples + "/expect/stats_single/" + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + fp := fingerprinter.NewFingerprinter(fingerprinter.DEFAULT_KEY_FILTERS) + + for _, file := range files { + f := file.Name() + t.Run(f, func(t *testing.T) { + t.Parallel() + + doc := proto.SystemProfile{} + err = tutil.LoadBson(dir+f, &doc) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+f, err) + } + s := New(fp) + + err = s.Add(doc) + if err != nil { + t.Errorf("Error processing doc: %s\n", err.Error()) + } + got := s.Queries() + expect := Queries{} + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(dirExpect+f, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + err = tutil.LoadJson(dirExpect+f, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", dirExpect+f, err) + } + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } + }) + } + +} + +func TestStatsAll(t *testing.T) { + t.Parallel() + + f := vars.RootPath + samples + "/expect/stats_all/sum.json" + + dir := vars.RootPath + samples + "/doc/out/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + fp := fingerprinter.NewFingerprinter(fingerprinter.DEFAULT_KEY_FILTERS) + s := New(fp) + + for _, file := range files { + doc := proto.SystemProfile{} + err = tutil.LoadBson(dir+file.Name(), &doc) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err) + } + + err = s.Add(doc) + if err != nil { + t.Errorf("Error processing doc: %s\n", err.Error()) + } + } + + got := s.Queries() + expect := Queries{} + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(f, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + err = tutil.LoadJson(f, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", f, err) + } + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } +} + +func TestAvailableMetrics(t *testing.T) { + t.Parallel() + + var err error + dirExpect := vars.RootPath + samples + "/expect/available_metrics/" + dir := vars.RootPath + samples + "/doc/out/" + + versions := []string{ + "2.6.12", + "3.0.15", + "3.2.16", + "3.4.7", + "3.5.11", + } + + samples := []string{ + "aggregate", + "count", + "count_with_query", + "delete", + "delete_all", + "distinct", + "find", + "find_andrii", + "find_empty", + "findandmodify", + "geonear", + "group", + "insert", + "mapreduce", + "update", + "explain", + "eval", + } + + type sp struct { + DocsExamined *int `bson:"docsExamined" json:",omitempty"` + NscannedObjects *int `bson:"nscannedObjects" json:",omitempty"` + Millis *int `bson:"millis" json:",omitempty"` + Nreturned *int `bson:"nreturned" json:",omitempty"` + ResponseLength *int `bson:"responseLength" json:",omitempty"` + } + + data := map[string]map[string]sp{} + + for _, sample := range samples { + for _, v := range versions { + f := sample + "_" + v + s := sp{} + err = tutil.LoadBson(dir+f, &s) + if err != nil { + t.Fatalf("cannot load sample %s: %s", dir+f, err) + } + + if data[sample] == nil { + data[sample] = map[string]sp{} + } + data[sample][v] = s + } + } + + t.Run("available_metrics", func(t *testing.T) { + got := data + fExpect := dirExpect + "available_metrics" + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(fExpect, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + + expect := map[string]map[string]sp{} + err = tutil.LoadJson(fExpect, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", fExpect, err) + } + + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } + + }) + + t.Run("cmd_metric", func(t *testing.T) { + got := map[string]map[string][]string{} + for s := range data { + for v := range data[s] { + if got[s] == nil { + got[s] = map[string][]string{} + } + if data[s][v].Millis != nil { + got[s]["Query Time"] = append(got[s]["Query Time"], v) + } + if data[s][v].DocsExamined != nil || data[s][v].NscannedObjects != nil { + got[s]["Docs Scanned"] = append(got[s]["Docs Scanned"], v) + } + if data[s][v].Nreturned != nil { + got[s]["Docs Returned"] = append(got[s]["Docs Returned"], v) + } + if data[s][v].ResponseLength != nil { + got[s]["Bytes Sent"] = append(got[s]["Bytes Sent"], v) + } + } + } + + metrics := []string{ + "Query Time", + "Docs Scanned", + "Docs Returned", + "Bytes Sent", + } + for cmd := range got { + for metric := range got[cmd] { + if len(got[cmd][metric]) == len(versions) { + got[cmd][metric] = []string{"yes"} + } else { + sort.Strings(got[cmd][metric]) + } + } + + for _, metric := range metrics { + if len(got[cmd][metric]) == 0 { + got[cmd][metric] = []string{"no"} + } + } + } + + fExpect := dirExpect + "cmd_metric" + if tutil.ShouldUpdateSamples() { + err := tutil.WriteJson(fExpect, got) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + + expect := map[string]map[string][]string{} + err = tutil.LoadJson(fExpect, &expect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", fExpect, err) + } + + if !reflect.DeepEqual(got, expect) { + t.Errorf("s.Queries() = %s, want %s", got, expect) + } + + data := got + t.Run("md", func(t *testing.T) { + type result struct { + Metrics []string + Samples []string + Data map[string]map[string][]string + } + r := result{ + Metrics: metrics, + Samples: samples, + Data: data, + } + sort.Strings(r.Metrics) + sort.Strings(r.Samples) + + tmpl := template.New("") + tmpl = tmpl.Funcs(template.FuncMap{"join": strings.Join}) + tmpl, err := tmpl.Parse(`| |{{range .Metrics}} {{.}} |{{end}} +| - |{{range .Metrics}} - |{{end}}{{range $s := .Samples}} +| {{$s}} |{{range $m := $.Metrics}} {{join (index $.Data $s $m) ", "}} |{{end}}{{end}}`) + if err != nil { + panic(err) + } + var bufGot bytes.Buffer + err = tmpl.Execute(&bufGot, r) + if err != nil { + panic(err) + } + got := bufGot.String() + + fExpect := dirExpect + "cmd_metric.md" + if tutil.ShouldUpdateSamples() { + err = ioutil.WriteFile(fExpect, bufGot.Bytes(), 0777) + if err != nil { + fmt.Printf("cannot update samples: %s", err.Error()) + } + } + + buf, err := ioutil.ReadFile(fExpect) + if err != nil { + t.Fatalf("cannot load expected data %s: %s", fExpect, err) + } + expect := string(buf) + + if !reflect.DeepEqual(got, expect) { + t.Errorf("got %s, want %s", got, expect) + } + }) + }) +} diff --git a/src/go/mongolib/util/util.go b/src/go/mongolib/util/util.go index 259489aa..e8ad249d 100644 --- a/src/go/mongolib/util/util.go +++ b/src/go/mongolib/util/util.go @@ -237,21 +237,71 @@ func GetServerStatus(dialer pmgo.Dialer, di *pmgo.DialInfo, hostname string) (pr return ss, nil } -func GetQueryField(query map[string]interface{}) (map[string]interface{}, error) { - // MongoDB 3.0 - if squery, ok := query["$query"]; ok { +func GetQueryField(doc proto.SystemProfile) (bson.M, error) { + // Proper way to detect if protocol used is "op_msg" or "op_command" + // would be to look at "doc.Protocol" field, + // however MongoDB 3.0 doesn't have that field + // so we need to detect protocol by looking at actual data. + query := doc.Query + if doc.Command.Len() > 0 { + query = doc.Command + if doc.Op == "update" || doc.Op == "remove" { + if squery, ok := query.Map()["q"]; ok { + // just an extra check to ensure this type assertion won't fail + if ssquery, ok := squery.(bson.M); ok { + return ssquery, nil + } + return nil, CANNOT_GET_QUERY_ERROR + } + } + } + + // "query" in MongoDB 3.0 can look like this: + // { + // "op" : "query", + // "ns" : "test.coll", + // "query" : { + // "a" : 1 + // }, + // ... + // } + // + // but also it can have "query" subkey like this: + // { + // "op" : "query", + // "ns" : "test.coll", + // "query" : { + // "query" : { + // "$and" : [ + // ] + // }, + // "orderby" : { + // "k" : -1 + // } + // }, + // ... + // } + // + if squery, ok := query.Map()["query"]; ok { // just an extra check to ensure this type assertion won't fail - if ssquery, ok := squery.(map[string]interface{}); ok { + if ssquery, ok := squery.(bson.M); ok { return ssquery, nil } return nil, CANNOT_GET_QUERY_ERROR } - // MongoDB 3.2+ - if squery, ok := query["filter"]; ok { - if ssquery, ok := squery.(map[string]interface{}); ok { + + // "query" in MongoDB 3.2+ is better structured and always has a "filter" subkey: + if squery, ok := query.Map()["filter"]; ok { + if ssquery, ok := squery.(bson.M); ok { return ssquery, nil } return nil, CANNOT_GET_QUERY_ERROR } - return query, nil + + // {"ns":"test.system.js","op":"query","query":{"find":"system.js"}} + if len(query) == 1 && query[0].Name == "find" { + return bson.M{}, nil + } + + return query.Map(), nil } diff --git a/src/go/pt-mongodb-query-digest/main.go b/src/go/pt-mongodb-query-digest/main.go index d6548fe1..4eefd044 100644 --- a/src/go/pt-mongodb-query-digest/main.go +++ b/src/go/pt-mongodb-query-digest/main.go @@ -62,7 +62,7 @@ func main() { opts, err := getOptions() if err != nil { - log.Errorf("error processing commad line arguments: %s", err) + log.Errorf("error processing command line arguments: %s", err) os.Exit(1) } if opts == nil && err == nil { @@ -95,6 +95,8 @@ func main() { } } + log.Debugf("Command line options:\n%+v\n", opts) + di := getDialInfo(opts) if di.Database == "" { log.Errorln("must indicate a database as host:[port]/database") @@ -104,6 +106,7 @@ func main() { dialer := pmgo.NewDialer() session, err := dialer.DialWithInfo(di) + log.Debugf("Dial Info: %+v\n", di) if err != nil { log.Errorf("Error connecting to the db: %s while trying to connect to %s", err, di.Addrs[0]) os.Exit(3) @@ -133,8 +136,7 @@ func main() { filters = append(filters, filter.NewFilterByCollection(opts.SkipCollections)) } - query := bson.M{"op": bson.M{"$nin": []string{"getmore", "delete"}}} - i := session.DB(di.Database).C("system.profile").Find(query).Sort("-$natural").Iter() + i := session.DB(di.Database).C("system.profile").Find(bson.M{}).Sort("-$natural").Iter() fp := fingerprinter.NewFingerprinter(fingerprinter.DEFAULT_KEY_FILTERS) s := stats.New(fp) @@ -162,7 +164,8 @@ func main() { if opts.Limit > 0 && len(sortedQueryStats) > opts.Limit { sortedQueryStats = sortedQueryStats[:opts.Limit] } - for _, qs := range sortedQueryStats { + for i, qs := range sortedQueryStats { + qs.Rank = i + 1 t.Execute(os.Stdout, qs) } @@ -278,10 +281,10 @@ func getDialInfo(opts *options) *pmgo.DialInfo { di, _ := mgo.ParseURL(opts.Host) di.FailFast = true - if di.Username != "" { + if di.Username == "" { di.Username = opts.User } - if di.Password != "" { + if di.Password == "" { di.Password = opts.Password } if opts.AuthDB != "" { @@ -323,9 +326,9 @@ func getQueryTemplate() string { # Exec Time ms {{printf "% 4.0f" .QueryTime.Pct}} {{printf "% 7.0f " .QueryTime.Total}} {{printf "% 7.0f " .QueryTime.Min}} {{printf "% 7.0f " .QueryTime.Max}} {{printf "% 7.0f " .QueryTime.Avg}} {{printf "% 7.0f " .QueryTime.Pct95}} {{printf "% 7.0f " .QueryTime.StdDev}} {{printf "% 7.0f " .QueryTime.Median}} # Docs Scanned {{printf "% 4.0f" .Scanned.Pct}} {{Format .Scanned.Total 7.2}} {{Format .Scanned.Min 7.2}} {{Format .Scanned.Max 7.2}} {{Format .Scanned.Avg 7.2}} {{Format .Scanned.Pct95 7.2}} {{Format .Scanned.StdDev 7.2}} {{Format .Scanned.Median 7.2}} # Docs Returned {{printf "% 4.0f" .Returned.Pct}} {{Format .Returned.Total 7.2}} {{Format .Returned.Min 7.2}} {{Format .Returned.Max 7.2}} {{Format .Returned.Avg 7.2}} {{Format .Returned.Pct95 7.2}} {{Format .Returned.StdDev 7.2}} {{Format .Returned.Median 7.2}} -# Bytes recv {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} +# Bytes sent {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} # String: -# Namespaces {{.Namespace}} +# Namespace {{.Namespace}} # Operation {{.Operation}} # Fingerprint {{.Fingerprint}} # Query {{.Query}} @@ -343,7 +346,7 @@ func getTotalsTemplate() string { # Exec Time ms {{printf "% 4.0f" .QueryTime.Pct}} {{printf "% 7.0f " .QueryTime.Total}} {{printf "% 7.0f " .QueryTime.Min}} {{printf "% 7.0f " .QueryTime.Max}} {{printf "% 7.0f " .QueryTime.Avg}} {{printf "% 7.0f " .QueryTime.Pct95}} {{printf "% 7.0f " .QueryTime.StdDev}} {{printf "% 7.0f " .QueryTime.Median}} # Docs Scanned {{printf "% 4.0f" .Scanned.Pct}} {{Format .Scanned.Total 7.2}} {{Format .Scanned.Min 7.2}} {{Format .Scanned.Max 7.2}} {{Format .Scanned.Avg 7.2}} {{Format .Scanned.Pct95 7.2}} {{Format .Scanned.StdDev 7.2}} {{Format .Scanned.Median 7.2}} # Docs Returned {{printf "% 4.0f" .Returned.Pct}} {{Format .Returned.Total 7.2}} {{Format .Returned.Min 7.2}} {{Format .Returned.Max 7.2}} {{Format .Returned.Avg 7.2}} {{Format .Returned.Pct95 7.2}} {{Format .Returned.StdDev 7.2}} {{Format .Returned.Median 7.2}} -# Bytes recv {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} +# Bytes sent {{printf "% 4.0f" .ResponseLength.Pct}} {{Format .ResponseLength.Total 7.2}} {{Format .ResponseLength.Min 7.2}} {{Format .ResponseLength.Max 7.2}} {{Format .ResponseLength.Avg 7.2}} {{Format .ResponseLength.Pct95 7.2}} {{Format .ResponseLength.StdDev 7.2}} {{Format .ResponseLength.Median 7.2}} # ` return t @@ -423,15 +426,11 @@ func sortQueries(queries []stats.QueryStats, orderby []string) []stats.QueryStat case "ratio": f = func(c1, c2 *stats.QueryStats) bool { - ratio1 := c1.Scanned.Max / c1.Returned.Max - ratio2 := c2.Scanned.Max / c2.Returned.Max - return ratio1 < ratio2 + return c1.Ratio < c2.Ratio } case "-ratio": f = func(c1, c2 *stats.QueryStats) bool { - ratio1 := c1.Scanned.Max / c1.Returned.Max - ratio2 := c2.Scanned.Max / c2.Returned.Max - return ratio1 > ratio2 + return c1.Ratio > c2.Ratio } // diff --git a/src/go/pt-mongodb-query-digest/main_test.go b/src/go/pt-mongodb-query-digest/main_test.go index 8260b180..f1260176 100644 --- a/src/go/pt-mongodb-query-digest/main_test.go +++ b/src/go/pt-mongodb-query-digest/main_test.go @@ -1,21 +1,50 @@ package main import ( + "bufio" + "bytes" + "context" + "fmt" "io/ioutil" + "log" "os" + "os/exec" "reflect" + "regexp" + "runtime" + "sort" "strings" "testing" + "text/template" + "time" "github.com/pborman/getopt/v2" + "github.com/percona/percona-toolkit/src/go/lib/profiling" + "github.com/percona/percona-toolkit/src/go/lib/tutil" + "github.com/percona/percona-toolkit/src/go/mongolib/stats" "github.com/percona/pmgo" - "gopkg.in/mgo.v2/dbtest" ) +const ( + samples = "/src/go/tests/" +) + +type testVars struct { + RootPath string +} + +var vars testVars var Server dbtest.DBServer func TestMain(m *testing.M) { + var err error + if vars.RootPath, err = tutil.RootPath(); err != nil { + log.Printf("cannot get root path: %s", err.Error()) + os.Exit(1) + } + os.Exit(m.Run()) + // The tempdir is created so MongoDB has a location to store its files. // Contents are wiped once the server stops os.Setenv("CHECK_SESSIONS", "0") @@ -98,3 +127,388 @@ func TestParseArgs(t *testing.T) { } } + +type Data struct { + bin string + url string +} + +func TestPTMongoDBQueryDigest(t *testing.T) { + var err error + + binDir, err := ioutil.TempDir("/tmp", "pmm-client-test-bindir-") + if err != nil { + t.Error(err) + } + defer func() { + err := os.RemoveAll(binDir) + if err != nil { + t.Error(err) + } + }() + + bin := binDir + "/pt-mongodb-query-digest" + xVariables := map[string]string{ + "main.Build": "", + "main.Version": "", + "main.GoVersion": "", + } + var ldflags []string + for x, value := range xVariables { + ldflags = append(ldflags, fmt.Sprintf("-X %s=%s", x, value)) + } + cmd := exec.Command( + "go", + "build", + "-o", + bin, + "-ldflags", + strings.Join(ldflags, " "), + ) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err = cmd.Run() + if err != nil { + t.Error(err) + } + + data := Data{ + bin: bin, + } + tests := []func(*testing.T, Data){ + testVersion, + testEmptySystemProfile, + testAllOperationsTemplate, + } + t.Run("pmm-admin", func(t *testing.T) { + for _, f := range tests { + f := f // capture range variable + fName := runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name() + t.Run(fName, func(t *testing.T) { + // Clean up system.profile + var err error + data.url = "127.0.0.1/test" + err = profiling.Disable(data.url) + if err != nil { + t.Error(err) + } + profiling.Drop(data.url) + err = profiling.Enable(data.url) + if err != nil { + t.Error(err) + } + defer profiling.Disable(data.url) + + // t.Parallel() + f(t, data) + }) + } + }) + +} + +func testVersion(t *testing.T, data Data) { + cmd := exec.Command( + data.bin, + "--version", + ) + output, err := cmd.CombinedOutput() + if err != nil { + t.Error(err) + } + expected := `pt-mongodb-query-digest +Version +Build: using ` + + assertRegexpLines(t, expected, string(output)) +} + +func testEmptySystemProfile(t *testing.T, data Data) { + cmd := exec.Command( + data.bin, + data.url, + ) + output, err := cmd.CombinedOutput() + if err != nil { + t.Error(err) + } + + expected := `pt-mongodb-query-digest .+ +Host: ` + data.url + ` +Skipping profiled queries on these collections: \[system\.profile\] + + +# Totals +# Ratio 0.00 \(docs scanned/returned\) +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) 0\s +# Exec Time ms 0 NaN NaN NaN NaN NaN NaN NaN\s +# Docs Scanned 0 NaN NaN NaN NaN NaN NaN NaN\s +# Docs Returned 0 NaN NaN NaN NaN NaN NaN NaN\s +# Bytes sent 0 NaN NaN NaN NaN NaN NaN NaN\s +#\s +` + + assertRegexpLines(t, expected, string(output)) +} + +func testAllOperationsTemplate(t *testing.T, data Data) { + dir := vars.RootPath + samples + "/doc/script/profile/" + files, err := ioutil.ReadDir(dir) + if err != nil { + t.Fatalf("cannot list samples: %s", err) + } + + fs := []string{} + for _, file := range files { + fs = append(fs, dir+file.Name()) + } + sort.Strings(fs) + err = run(fs...) + if err != nil { + t.Fatalf("cannot execute queries: %s", err) + } + + // disable profiling so pt-mongodb-query digest reads rows from `system.profile` + profiling.Disable(data.url) + + // run profiler + cmd := exec.Command( + data.bin, + data.url, + ) + + output, err := cmd.CombinedOutput() + if err != nil { + t.Error(err) + } + + queries := []stats.QueryStats{ + { + ID: "e357abe482dcc0cd03ab742741bf1c86", + Namespace: "test.coll", + Operation: "INSERT", + Fingerprint: "INSERT coll", + }, + { + ID: "c9b40ce564762834d12b0390a292645c", + Namespace: "test.coll", + Operation: "DROP", + Fingerprint: "DROP coll drop", + }, + { + ID: "db759bfd83441deecc71382323041ce6", + Namespace: "test.coll", + Operation: "GETMORE", + Fingerprint: "GETMORE coll", + }, + { + ID: "e72ad41302045bd6c2bcad76511f915a", + Namespace: "test.coll", + Operation: "REMOVE", + Fingerprint: "REMOVE coll a,b", + }, + { + ID: "30dbfbc89efd8cfd40774dff0266a28f", + Namespace: "test.coll", + Operation: "AGGREGATE", + Fingerprint: "AGGREGATE coll a", + }, + { + ID: "a6782ae38ef891d5506341a4b0ab2747", + Namespace: "test", + Operation: "EVAL", + Fingerprint: "EVAL", + }, + { + ID: "76d7662df07b44135ac3e07e44a6eb39", + Namespace: "", + Operation: "EXPLAIN", + Fingerprint: "EXPLAIN", + }, + { + ID: "e8a3f05a4bd3f0bfa7d38eb2372258b1", + Namespace: "test.coll", + Operation: "FINDANDMODIFY", + Fingerprint: "FINDANDMODIFY coll a", + }, + { + ID: "2a639e77efe3e68399ef9482575b3421", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll", + }, + { + ID: "fe0bf975a044fe47fd32b835ceba612d", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll a", + }, + { + ID: "20fe80188ec82c9d3c3dcf3f4817f8f9", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll b,c", + }, + { + ID: "02104210d67fe680273784d833f86831", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll c,k,pad", + }, + { + ID: "5efe4738d807c74b3980de76c37a0870", + Namespace: "test.coll", + Operation: "FIND", + Fingerprint: "FIND coll k", + }, + { + ID: "798d7c1cd25b63cb6a307126a25910d6", + Namespace: "test.system.js", + Operation: "FIND", + Fingerprint: "FIND system.js", + }, + { + ID: "c70403cbd55ffbb07f08c0cb77a24b19", + Namespace: "test.coll", + Operation: "GEONEAR", + Fingerprint: "GEONEAR coll", + }, + { + ID: "e4122a58c99ab0a4020ce7d195c5a8cb", + Namespace: "test.coll", + Operation: "DISTINCT", + Fingerprint: "DISTINCT coll a,b", + }, + { + ID: "ca8bb19386488570447f5753741fb494", + Namespace: "test.coll", + Operation: "GROUP", + Fingerprint: "GROUP coll a,b", + }, + { + ID: "10b8f47b366fbfd1fb01f8d17d75b1a2", + Namespace: "test.coll", + Operation: "COUNT", + Fingerprint: "COUNT coll a", + }, + { + ID: "cc3cb3824eea4094eb042f5ca76bd385", + Namespace: "test.coll", + Operation: "MAPREDUCE", + Fingerprint: "MAPREDUCE coll a", + }, + { + ID: "cba2dff0740762c6e5769f0e300df676", + Namespace: "test.coll", + Operation: "COUNT", + Fingerprint: "COUNT coll", + }, + { + ID: "f74a5120ac22d02120ccbf6d478b0dbc", + Namespace: "test.coll", + Operation: "UPDATE", + Fingerprint: "UPDATE coll a", + }, + } + + expected := `Profiler is disabled for the "test" database but there are \s*[0-9]+ documents in the system.profile collection. +Using those documents for the stats +pt-mongodb-query-digest .+ +Host: ` + data.url + ` +Skipping profiled queries on these collections: \[system\.profile\] + + +# Totals +# Ratio [0-9\.]+ \(docs scanned/returned\) +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) (\s*[0-9]+)\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes sent (\s*[0-9\.K]+){8}(K|\s) +#\s +` + + queryTpl := ` +# Query [0-9]+: [0-9\.]+ QPS, ID {{.ID}} +# Ratio [0-9\.]+ \(docs scanned/returned\) +# Time range: .* to .* +# Attribute pct total min max avg 95% stddev median +# ================== === ======== ======== ======== ======== ======== ======= ======== +# Count \(docs\) (\s*[0-9]+)\s +# Exec Time ms (\s*[0-9]+){8}\s +# Docs Scanned (\s*[0-9\.]+){8}\s +# Docs Returned (\s*[0-9\.]+){8}\s +# Bytes sent (\s*[0-9\.K]+){8}(K|\s) +# String: +# Namespace {{.Namespace}} +# Operation {{.Operation}} +# Fingerprint {{.Fingerprint}} +# Query .* + +` + + tpl, _ := template.New("query").Parse(queryTpl) + for _, query := range queries { + buf := bytes.Buffer{} + err := tpl.Execute(&buf, query) + if err != nil { + t.Error(err) + } + + expected += buf.String() + } + + assertRegexpLines(t, expected, string(output)) +} + +// assertRegexpLines matches regexp line by line to corresponding line of text +func assertRegexpLines(t *testing.T, rx string, str string, msgAndArgs ...interface{}) bool { + expectedScanner := bufio.NewScanner(strings.NewReader(rx)) + defer func() { + if err := expectedScanner.Err(); err != nil { + t.Fatal(err) + } + }() + + actualScanner := bufio.NewScanner(strings.NewReader(str)) + defer func() { + if err := actualScanner.Err(); err != nil { + t.Fatal(err) + } + }() + + ok := true + for { + asOk := actualScanner.Scan() + esOk := expectedScanner.Scan() + + switch { + case asOk && esOk: + ok, err := regexp.MatchString("^"+expectedScanner.Text()+"$", actualScanner.Text()) + if err != nil { + t.Error(err) + } + if !ok { + t.Errorf("regexp '%s' doesn't match '%s'", expectedScanner.Text(), actualScanner.Text()) + } + case asOk: + t.Errorf("didn't expect more lines but got: %s", actualScanner.Text()) + ok = false + case esOk: + t.Errorf("didn't got line but expected it to match against: %s", expectedScanner.Text()) + ok = false + default: + return ok + } + } +} + +func run(arg ...string) error { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + return exec.CommandContext(ctx, "mongo", arg...).Run() +} diff --git a/src/go/pt-mongodb-summary/main.go b/src/go/pt-mongodb-summary/main.go index e272b396..f3b0a4dd 100644 --- a/src/go/pt-mongodb-summary/main.go +++ b/src/go/pt-mongodb-summary/main.go @@ -1,11 +1,13 @@ package main import ( + "bytes" + "encoding/json" "fmt" + "html/template" "net" "os" "strings" - "text/template" "time" version "github.com/hashicorp/go-version" @@ -33,6 +35,7 @@ const ( DEFAULT_LOGLEVEL = "warn" DEFAULT_RUNNINGOPSINTERVAL = 1000 // milliseconds DEFAULT_RUNNINGOPSSAMPLES = 5 + DEFAULT_OUTPUT_FORMAT = "text" ) var ( @@ -130,12 +133,24 @@ type options struct { Version bool NoVersionCheck bool NoRunningOps bool + OutputFormat string RunningOpsSamples int RunningOpsInterval int SSLCAFile string SSLPEMKeyFile string } +type collectedInfo struct { + BalancerStats *proto.BalancerStats + ClusterWideInfo *clusterwideInfo + OplogInfo []proto.OplogInfo + ReplicaMembers []proto.Members + RunningOps *opCounters + SecuritySettings *security + HostInfo *hostInfo + Errors []string +} + func main() { opts, err := parseFlags() @@ -210,77 +225,105 @@ func main() { defer session.Close() session.SetMode(mgo.Monotonic, true) - hostInfo, err := GetHostinfo(session) + ci := &collectedInfo{} + + ci.HostInfo, err = GetHostinfo(session) if err != nil { message := fmt.Sprintf("Cannot get host info for %q: %s", di.Addrs[0], err.Error()) log.Errorf(message) os.Exit(2) } - if replicaMembers, err := util.GetReplicasetMembers(dialer, di); err != nil { + if ci.ReplicaMembers, err = util.GetReplicasetMembers(dialer, di); err != nil { log.Warnf("[Error] cannot get replicaset members: %v\n", err) os.Exit(2) - } else { - log.Debugf("replicaMembers:\n%+v\n", replicaMembers) - t := template.Must(template.New("replicas").Parse(templates.Replicas)) - t.Execute(os.Stdout, replicaMembers) } - - // Host Info - t := template.Must(template.New("hosttemplateData").Parse(templates.HostInfo)) - t.Execute(os.Stdout, hostInfo) + log.Debugf("replicaMembers:\n%+v\n", ci.ReplicaMembers) if opts.RunningOpsSamples > 0 && opts.RunningOpsInterval > 0 { - if rops, err := GetOpCountersStats(session, opts.RunningOpsSamples, time.Duration(opts.RunningOpsInterval)*time.Millisecond); err != nil { + if ci.RunningOps, err = GetOpCountersStats(session, opts.RunningOpsSamples, time.Duration(opts.RunningOpsInterval)*time.Millisecond); err != nil { log.Printf("[Error] cannot get Opcounters stats: %v\n", err) - } else { - t := template.Must(template.New("runningOps").Parse(templates.RunningOps)) - t.Execute(os.Stdout, rops) } } - if hostInfo != nil { - if security, err := GetSecuritySettings(session, hostInfo.Version); err != nil { + if ci.HostInfo != nil { + if ci.SecuritySettings, err = GetSecuritySettings(session, ci.HostInfo.Version); err != nil { log.Errorf("[Error] cannot get security settings: %v\n", err) - } else { - t := template.Must(template.New("ssl").Parse(templates.Security)) - t.Execute(os.Stdout, security) } } else { log.Warn("Cannot check security settings since host info is not available (permissions?)") } - if oplogInfo, err := oplog.GetOplogInfo(hostnames, di); err != nil { + if ci.OplogInfo, err = oplog.GetOplogInfo(hostnames, di); err != nil { log.Info("Cannot get Oplog info: %v\n", err) } else { - if len(oplogInfo) > 0 { - t := template.Must(template.New("oplogInfo").Parse(templates.Oplog)) - t.Execute(os.Stdout, oplogInfo[0]) - } else { - + if len(ci.OplogInfo) == 0 { log.Info("oplog info is empty. Skipping") + } else { + ci.OplogInfo = ci.OplogInfo[:1] } } // individual servers won't know about this info - if hostInfo.NodeType == "mongos" { - if cwi, err := GetClusterwideInfo(session); err != nil { + if ci.HostInfo.NodeType == "mongos" { + if ci.ClusterWideInfo, err = GetClusterwideInfo(session); err != nil { log.Printf("[Error] cannot get cluster wide info: %v\n", err) - } else { - t := template.Must(template.New("clusterwide").Parse(templates.Clusterwide)) - t.Execute(os.Stdout, cwi) } } - if hostInfo.NodeType == "mongos" { - if bs, err := GetBalancerStats(session); err != nil { + if ci.HostInfo.NodeType == "mongos" { + if ci.BalancerStats, err = GetBalancerStats(session); err != nil { log.Printf("[Error] cannot get balancer stats: %v\n", err) - } else { - t := template.Must(template.New("balancer").Parse(templates.BalancerStats)) - t.Execute(os.Stdout, bs) } } + out, err := formatResults(ci, opts.OutputFormat) + if err != nil { + log.Errorf("Cannot format the results: %s", err.Error()) + os.Exit(1) + } + fmt.Println(string(out)) + +} + +func formatResults(ci *collectedInfo, format string) ([]byte, error) { + var buf *bytes.Buffer + + switch format { + case "json": + b, err := json.MarshalIndent(ci, "", " ") + if err != nil { + return nil, fmt.Errorf("[Error] Cannot convert results to json: %s", err.Error()) + } + buf = bytes.NewBuffer(b) + default: + buf = new(bytes.Buffer) + + t := template.Must(template.New("replicas").Parse(templates.Replicas)) + t.Execute(buf, ci.ReplicaMembers) + + t = template.Must(template.New("hosttemplateData").Parse(templates.HostInfo)) + t.Execute(buf, ci.HostInfo) + + t = template.Must(template.New("runningOps").Parse(templates.RunningOps)) + t.Execute(buf, ci.RunningOps) + + t = template.Must(template.New("ssl").Parse(templates.Security)) + t.Execute(buf, ci.SecuritySettings) + + if ci.OplogInfo != nil && len(ci.OplogInfo) > 0 { + t = template.Must(template.New("oplogInfo").Parse(templates.Oplog)) + t.Execute(buf, ci.OplogInfo[0]) + } + + t = template.Must(template.New("clusterwide").Parse(templates.Clusterwide)) + t.Execute(buf, ci.ClusterWideInfo) + + t = template.Must(template.New("balancer").Parse(templates.BalancerStats)) + t.Execute(buf, ci.BalancerStats) + } + + return buf.Bytes(), nil } func GetHostinfo(session pmgo.SessionManager) (*hostInfo, error) { @@ -461,7 +504,7 @@ func GetSecuritySettings(session pmgo.SessionManager, ver string) (*security, er } } else { if ip != "127.0.0.1" && ip != extIP { - s.WarningMsgs = append(s.WarningMsgs, fmt.Sprintf("WARNING: You might be insecure. IP binding %s is not localhost")) + s.WarningMsgs = append(s.WarningMsgs, fmt.Sprintf("WARNING: You might be insecure. IP binding %s is not localhost", ip)) } } } @@ -472,6 +515,7 @@ func GetSecuritySettings(session pmgo.SessionManager, ver string) (*security, er // Lets try both newSession := session.Clone() defer newSession.Close() + newSession.SetMode(mgo.Strong, true) if s.Users, s.Roles, err = getUserRolesCount(newSession); err != nil { @@ -811,6 +855,7 @@ func parseFlags() (*options, error) { RunningOpsSamples: DEFAULT_RUNNINGOPSSAMPLES, RunningOpsInterval: DEFAULT_RUNNINGOPSINTERVAL, // milliseconds AuthDB: DEFAULT_AUTHDB, + OutputFormat: DEFAULT_OUTPUT_FORMAT, } gop := getopt.New() @@ -821,8 +866,9 @@ func parseFlags() (*options, error) { gop.StringVarLong(&opts.User, "username", 'u', "", "Username to use for optional MongoDB authentication") gop.StringVarLong(&opts.Password, "password", 'p', "", "Password to use for optional MongoDB authentication").SetOptional() gop.StringVarLong(&opts.AuthDB, "authenticationDatabase", 'a', "admin", - "Databaae to use for optional MongoDB authentication. Default: admin") + "Database to use for optional MongoDB authentication. Default: admin") gop.StringVarLong(&opts.LogLevel, "log-level", 'l', "error", "Log level: panic, fatal, error, warn, info, debug. Default: error") + gop.StringVarLong(&opts.OutputFormat, "output-format", 'f', "text", "Output format: text, json. Default: text") gop.IntVarLong(&opts.RunningOpsSamples, "running-ops-samples", 's', fmt.Sprintf("Number of samples to collect for running ops. Default: %d", opts.RunningOpsSamples)) @@ -852,6 +898,9 @@ func parseFlags() (*options, error) { gop.PrintUsage(os.Stdout) return nil, nil } + if opts.OutputFormat != "json" && opts.OutputFormat != "text" { + log.Infof("Invalid output format '%s'. Using text format", opts.OutputFormat) + } return opts, nil } diff --git a/src/go/pt-mongodb-summary/main_test.go b/src/go/pt-mongodb-summary/main_test.go index 1129f06c..4872d786 100644 --- a/src/go/pt-mongodb-summary/main_test.go +++ b/src/go/pt-mongodb-summary/main_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/dbtest" @@ -205,6 +206,9 @@ func TestSecurityOpts(t *testing.T) { session.EXPECT().DB("admin").Return(database) database.EXPECT().Run(bson.D{{"getCmdLineOpts", 1}, {"recordStats", 1}}, gomock.Any()).SetArg(1, cmd) + session.EXPECT().Clone().Return(session) + session.EXPECT().SetMode(mgo.Strong, true) + session.EXPECT().DB("admin").Return(database) database.EXPECT().C("system.users").Return(usersCol) usersCol.EXPECT().Count().Return(1, nil) @@ -212,6 +216,7 @@ func TestSecurityOpts(t *testing.T) { session.EXPECT().DB("admin").Return(database) database.EXPECT().C("system.roles").Return(rolesCol) rolesCol.EXPECT().Count().Return(2, nil) + session.EXPECT().Close().Return() got, err := GetSecuritySettings(session, "3.2") @@ -392,21 +397,25 @@ func TestParseArgs(t *testing.T) { { args: []string{TOOLNAME}, // arg[0] is the command itself want: &options{ - Host: DEFAULT_HOST, - LogLevel: DEFAULT_LOGLEVEL, - AuthDB: DEFAULT_AUTHDB, + Host: DEFAULT_HOST, + LogLevel: DEFAULT_LOGLEVEL, + AuthDB: DEFAULT_AUTHDB, + RunningOpsSamples: DEFAULT_RUNNINGOPSSAMPLES, + RunningOpsInterval: DEFAULT_RUNNINGOPSINTERVAL, + OutputFormat: "text", }, }, { args: []string{TOOLNAME, "zapp.brannigan.net:27018/samples", "--help"}, - want: &options{ - Host: "zapp.brannigan.net:27018/samples", - LogLevel: DEFAULT_LOGLEVEL, - AuthDB: DEFAULT_AUTHDB, - Help: true, - }, + want: nil, }, } + + // Capture stdout to not to show help + old := os.Stdout // keep backup of the real stdout + _, w, _ := os.Pipe() + os.Stdout = w + for i, test := range tests { getopt.Reset() os.Args = test.args @@ -419,4 +428,6 @@ func TestParseArgs(t *testing.T) { } } + os.Stdout = old + } diff --git a/src/go/pt-mongodb-summary/oplog/oplog.go b/src/go/pt-mongodb-summary/oplog/oplog.go index 943883f1..154ec496 100644 --- a/src/go/pt-mongodb-summary/oplog/oplog.go +++ b/src/go/pt-mongodb-summary/oplog/oplog.go @@ -58,8 +58,8 @@ func GetOplogInfo(hostnames []string, di *pmgo.DialInfo) ([]proto.OplogInfo, err } // https://docs.mongodb.com/manual/reference/bson-types/#timestamps - tfirst := firstRow.Ts >> 32 - tlast := lastRow.Ts >> 32 + tfirst := firstRow.Timestamp >> 32 + tlast := lastRow.Timestamp >> 32 result.TimeDiff = tlast - tfirst result.TimeDiffHours = float64(result.TimeDiff) / 3600 diff --git a/src/go/tests/doc/docker-compose.yml b/src/go/tests/doc/docker-compose.yml new file mode 100644 index 00000000..34b21d83 --- /dev/null +++ b/src/go/tests/doc/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3' +services: + mongo: + image: ${MONGO_IMAGE:-mongo} + volumes: + - ./script:/script + - ./out:/out diff --git a/src/go/tests/doc/out/aggregate_2.6.12 b/src/go/tests/doc/out/aggregate_2.6.12 new file mode 100644 index 00000000..037b4edf --- /dev/null +++ b/src/go/tests/doc/out/aggregate_2.6.12 @@ -0,0 +1,40 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(222), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(15), + "w" : NumberLong(6) + } + }, + "responseLength" : 385, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:08.661Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.0.15 b/src/go/tests/doc/out/aggregate_3.0.15 new file mode 100644 index 00000000..62ad4332 --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.0.15 @@ -0,0 +1,53 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(3) + } + } + }, + "responseLength" : 385, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:18.509Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.2.16 b/src/go/tests/doc/out/aggregate_3.2.16 new file mode 100644 index 00000000..adf0950b --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.2.16 @@ -0,0 +1,49 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 388, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:31.293Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.4.7 b/src/go/tests/doc/out/aggregate_3.4.7 new file mode 100644 index 00000000..ce833012 --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.4.7 @@ -0,0 +1,50 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + } + }, + "keysExamined" : 8, + "docsExamined" : 8, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(8) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "nreturned" : 8, + "responseLength" : 370, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "ts" : ISODate("2017-10-15T01:54:41.948Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/aggregate_3.5.11 b/src/go/tests/doc/out/aggregate_3.5.11 new file mode 100644 index 00000000..64b0f1ae --- /dev/null +++ b/src/go/tests/doc/out/aggregate_3.5.11 @@ -0,0 +1,51 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "aggregate" : "coll", + "pipeline" : [ + { + "$match" : { + "a" : { + "$gte" : 2 + } + } + } + ], + "cursor" : { + + }, + "$db" : "test" + }, + "keysExamined" : 8, + "docsExamined" : 8, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "nreturned" : 8, + "responseLength" : 370, + "protocol" : "op_msg", + "millis" : 2, + "planSummary" : "IXSCAN { a: 1 }", + "ts" : ISODate("2017-10-15T01:54:52.564Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_2.6.12 b/src/go/tests/doc/out/count_2.6.12 new file mode 100644 index 00000000..093b388e --- /dev/null +++ b/src/go/tests/doc/out/count_2.6.12 @@ -0,0 +1,34 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(33), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(3), + "w" : NumberLong(5) + } + }, + "responseLength" : 48, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:08.889Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.0.15 b/src/go/tests/doc/out/count_3.0.15 new file mode 100644 index 00000000..1513d50e --- /dev/null +++ b/src/go/tests/doc/out/count_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 44, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:18.673Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.2.16 b/src/go/tests/doc/out/count_3.2.16 new file mode 100644 index 00000000..101c99e2 --- /dev/null +++ b/src/go/tests/doc/out/count_3.2.16 @@ -0,0 +1,43 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 47, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:31.529Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.4.7 b/src/go/tests/doc/out/count_3.4.7 new file mode 100644 index 00000000..24567915 --- /dev/null +++ b/src/go/tests/doc/out/count_3.4.7 @@ -0,0 +1,57 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + } + }, + "keysExamined" : 0, + "docsExamined" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "COUNT", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 10, + "nSkipped" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:42.157Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_3.5.11 b/src/go/tests/doc/out/count_3.5.11 new file mode 100644 index 00000000..6ea4499b --- /dev/null +++ b/src/go/tests/doc/out/count_3.5.11 @@ -0,0 +1,58 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + + }, + "fields" : { + + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "COUNT", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 10, + "nSkipped" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:52.844Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_2.6.12 b/src/go/tests/doc/out/count_with_query_2.6.12 new file mode 100644 index 00000000..94f74603 --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_2.6.12 @@ -0,0 +1,36 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(75), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(6), + "w" : NumberLong(6) + } + }, + "responseLength" : 48, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:09.039Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.0.15 b/src/go/tests/doc/out/count_with_query_3.0.15 new file mode 100644 index 00000000..9f4d4cc1 --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.0.15 @@ -0,0 +1,49 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 44, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:18.838Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.2.16 b/src/go/tests/doc/out/count_with_query_3.2.16 new file mode 100644 index 00000000..4c71ff19 --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.2.16 @@ -0,0 +1,45 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 47, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:31.756Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.4.7 b/src/go/tests/doc/out/count_with_query_3.4.7 new file mode 100644 index 00000000..076352b6 --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.4.7 @@ -0,0 +1,79 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + } + }, + "keysExamined" : 0, + "docsExamined" : 10, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 12, + "advanced" : 0, + "needTime" : 11, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 4, + "nSkipped" : 0, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$gt" : 5 + } + }, + "nReturned" : 4, + "executionTimeMillisEstimate" : 0, + "works" : 12, + "advanced" : 4, + "needTime" : 7, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 10 + } + }, + "ts" : ISODate("2017-10-15T01:54:42.350Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/count_with_query_3.5.11 b/src/go/tests/doc/out/count_with_query_3.5.11 new file mode 100644 index 00000000..f7f27b5e --- /dev/null +++ b/src/go/tests/doc/out/count_with_query_3.5.11 @@ -0,0 +1,80 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "count" : "coll", + "query" : { + "a" : { + "$gt" : 5 + } + }, + "fields" : { + + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 10, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 29, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "COUNT", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 12, + "advanced" : 0, + "needTime" : 11, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nCounted" : 4, + "nSkipped" : 0, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$gt" : 5 + } + }, + "nReturned" : 4, + "executionTimeMillisEstimate" : 0, + "works" : 12, + "advanced" : 4, + "needTime" : 7, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 10 + } + }, + "ts" : ISODate("2017-10-15T01:54:53.078Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_2.6.12 b/src/go/tests/doc/out/delete_2.6.12 new file mode 100644 index 00000000..223c26bd --- /dev/null +++ b/src/go/tests/doc/out/delete_2.6.12 @@ -0,0 +1,33 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 1, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(144) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(11) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:09.246Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.0.15 b/src/go/tests/doc/out/delete_3.0.15 new file mode 100644 index 00000000..dc0b6b9b --- /dev/null +++ b/src/go/tests/doc/out/delete_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:19.034Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.2.16 b/src/go/tests/doc/out/delete_3.2.16 new file mode 100644 index 00000000..130dea8a --- /dev/null +++ b/src/go/tests/doc/out/delete_3.2.16 @@ -0,0 +1,42 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 1, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:32.020Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.4.7 b/src/go/tests/doc/out/delete_3.4.7 new file mode 100644 index 00000000..33b766bd --- /dev/null +++ b/src/go/tests/doc/out/delete_3.4.7 @@ -0,0 +1,113 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "keysExamined" : 1, + "docsExamined" : 1, + "ndeleted" : 1, + "keysDeleted" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 1, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 1, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:42.612Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_3.5.11 b/src/go/tests/doc/out/delete_3.5.11 new file mode 100644 index 00000000..d8d3e438 --- /dev/null +++ b/src/go/tests/doc/out/delete_3.5.11 @@ -0,0 +1,116 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "command" : { + "q" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "limit" : 1 + }, + "keysExamined" : 1, + "docsExamined" : 1, + "ndeleted" : 1, + "keysDeleted" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 1, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 1, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 1, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:53.333Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_2.6.12 b/src/go/tests/doc/out/delete_all_2.6.12 new file mode 100644 index 00000000..2b78e86a --- /dev/null +++ b/src/go/tests/doc/out/delete_all_2.6.12 @@ -0,0 +1,33 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 8, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(396) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(12) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:09.463Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.0.15 b/src/go/tests/doc/out/delete_all_3.0.15 new file mode 100644 index 00000000..37e00f6e --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 8, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(9) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:19.206Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.2.16 b/src/go/tests/doc/out/delete_all_3.2.16 new file mode 100644 index 00000000..05b1c027 --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.2.16 @@ -0,0 +1,42 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "ndeleted" : 8, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 1, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:32.281Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.4.7 b/src/go/tests/doc/out/delete_all_3.4.7 new file mode 100644 index 00000000..c9ef76b0 --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.4.7 @@ -0,0 +1,113 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "keysExamined" : 8, + "docsExamined" : 8, + "ndeleted" : 8, + "keysDeleted" : 16, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 1, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 0, + "needTime" : 8, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 8, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 8, + "restoreState" : 8, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 8, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 8, + "restoreState" : 8, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 8, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:42.820Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/delete_all_3.5.11 b/src/go/tests/doc/out/delete_all_3.5.11 new file mode 100644 index 00000000..21b31346 --- /dev/null +++ b/src/go/tests/doc/out/delete_all_3.5.11 @@ -0,0 +1,116 @@ +{ + "op" : "remove", + "ns" : "test.coll", + "command" : { + "q" : { + "a" : { + "$gte" : 2 + }, + "b" : { + "$gte" : 2 + } + }, + "limit" : 0 + }, + "keysExamined" : 8, + "docsExamined" : 8, + "ndeleted" : 8, + "keysDeleted" : 16, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 1, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "DELETE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 10, + "works" : 9, + "advanced" : 0, + "needTime" : 8, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nWouldDelete" : 8, + "nInvalidateSkips" : 0, + "inputStage" : { + "stage" : "FETCH", + "filter" : { + "b" : { + "$gte" : 2 + } + }, + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 8, + "restoreState" : 8, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 8, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 8, + "restoreState" : 8, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 8, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:53.615Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_2.6.12 b/src/go/tests/doc/out/distinct_2.6.12 new file mode 100644 index 00000000..35e9c086 --- /dev/null +++ b/src/go/tests/doc/out/distinct_2.6.12 @@ -0,0 +1,34 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(362), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(6), + "w" : NumberLong(9341) + } + }, + "responseLength" : 199, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:09.687Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.0.15 b/src/go/tests/doc/out/distinct_3.0.15 new file mode 100644 index 00000000..21bf1c7d --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.0.15 @@ -0,0 +1,47 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 206, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:19.380Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.2.16 b/src/go/tests/doc/out/distinct_3.2.16 new file mode 100644 index 00000000..4a702cc4 --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.2.16 @@ -0,0 +1,43 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 209, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:32.523Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.4.7 b/src/go/tests/doc/out/distinct_3.4.7 new file mode 100644 index 00000000..0ced8f0a --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.4.7 @@ -0,0 +1,93 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + } + }, + "keysExamined" : 5, + "docsExamined" : 5, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 90, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { b: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 5, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 5, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 5, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 5, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 5, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : 1 + }, + "indexName" : "b_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[5.0, inf.0]" + ] + }, + "keysExamined" : 5, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:43.048Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/distinct_3.5.11 b/src/go/tests/doc/out/distinct_3.5.11 new file mode 100644 index 00000000..69c8442e --- /dev/null +++ b/src/go/tests/doc/out/distinct_3.5.11 @@ -0,0 +1,94 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "distinct" : "coll", + "key" : "a", + "query" : { + "b" : { + "$gte" : 5 + } + }, + "$db" : "test" + }, + "keysExamined" : 5, + "docsExamined" : 5, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 90, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "IXSCAN { b: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 5, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 5, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 5, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 5, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 5, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : 1 + }, + "indexName" : "b_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[5.0, inf.0]" + ] + }, + "keysExamined" : 5, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:53.874Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_2.6.12 b/src/go/tests/doc/out/eval_2.6.12 new file mode 100644 index 00000000..d8ba0b6f --- /dev/null +++ b/src/go/tests/doc/out/eval_2.6.12 @@ -0,0 +1,30 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "$eval" : "1" + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "R" : NumberLong(0), + "W" : NumberLong(42972) + }, + "timeAcquiringMicros" : { + "R" : NumberLong(0), + "W" : NumberLong(8), + "r" : NumberLong(0), + "w" : NumberLong(6) + } + }, + "responseLength" : 53, + "millis" : 43, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:09.890Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.0.15 b/src/go/tests/doc/out/eval_3.0.15 new file mode 100644 index 00000000..f82cb588 --- /dev/null +++ b/src/go/tests/doc/out/eval_3.0.15 @@ -0,0 +1,42 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "$eval" : "1" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 53, + "millis" : 37, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:19.572Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.2.16 b/src/go/tests/doc/out/eval_3.2.16 new file mode 100644 index 00000000..6d632f6f --- /dev/null +++ b/src/go/tests/doc/out/eval_3.2.16 @@ -0,0 +1,38 @@ +{ + "op" : "command", + "ns" : "test", + "command" : { + "$eval" : "1" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 38, + "protocol" : "op_command", + "millis" : 56, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:32.759Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.4.7 b/src/go/tests/doc/out/eval_3.4.7 new file mode 100644 index 00000000..ebfc7b7c --- /dev/null +++ b/src/go/tests/doc/out/eval_3.4.7 @@ -0,0 +1,34 @@ +{ + "op" : "command", + "ns" : "test", + "command" : { + "$eval" : "1" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 38, + "protocol" : "op_command", + "millis" : 48, + "ts" : ISODate("2017-10-15T01:54:43.273Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/eval_3.5.11 b/src/go/tests/doc/out/eval_3.5.11 new file mode 100644 index 00000000..f2ff0ae7 --- /dev/null +++ b/src/go/tests/doc/out/eval_3.5.11 @@ -0,0 +1,35 @@ +{ + "op" : "command", + "ns" : "test", + "command" : { + "$eval" : "1", + "$db" : "test" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "W" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 38, + "protocol" : "op_msg", + "millis" : 40, + "ts" : ISODate("2017-10-15T01:54:54.085Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_2.6.12 b/src/go/tests/doc/out/explain_2.6.12 new file mode 100644 index 00000000..057bc3fa --- /dev/null +++ b/src/go/tests/doc/out/explain_2.6.12 @@ -0,0 +1,46 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + + }, + "$explain" : true + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 10, + "nscannedObjects" : 10, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(101), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(6), + "w" : NumberLong(11) + } + }, + "nreturned" : 1, + "responseLength" : 583, + "millis" : 0, + "execStats" : { + "type" : "COLLSCAN", + "works" : 12, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 10, + "needTime" : 1, + "needFetch" : 0, + "isEOF" : 1, + "docsTested" : 10, + "children" : [ ] + }, + "ts" : ISODate("2017-10-15T01:54:10.058Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.0.15 b/src/go/tests/doc/out/explain_3.0.15 new file mode 100644 index 00000000..f65e97cd --- /dev/null +++ b/src/go/tests/doc/out/explain_3.0.15 @@ -0,0 +1,50 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + }, + "options" : { + + } + }, + "verbosity" : "queryPlanner" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 379, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:19.722Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.2.16 b/src/go/tests/doc/out/explain_3.2.16 new file mode 100644 index 00000000..0d34e67c --- /dev/null +++ b/src/go/tests/doc/out/explain_3.2.16 @@ -0,0 +1,43 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + } + }, + "verbosity" : "queryPlanner" + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 364, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:32.931Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.4.7 b/src/go/tests/doc/out/explain_3.4.7 new file mode 100644 index 00000000..75e82c10 --- /dev/null +++ b/src/go/tests/doc/out/explain_3.4.7 @@ -0,0 +1,39 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + } + }, + "verbosity" : "queryPlanner" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 328, + "protocol" : "op_command", + "millis" : 0, + "ts" : ISODate("2017-10-15T01:54:43.427Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/explain_3.5.11 b/src/go/tests/doc/out/explain_3.5.11 new file mode 100644 index 00000000..aac05929 --- /dev/null +++ b/src/go/tests/doc/out/explain_3.5.11 @@ -0,0 +1,40 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "explain" : { + "find" : "coll", + "filter" : { + + } + }, + "verbosity" : "queryPlanner", + "$db" : "test" + }, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "responseLength" : 329, + "protocol" : "op_msg", + "millis" : 0, + "ts" : ISODate("2017-10-15T01:54:54.257Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_2.6.12 b/src/go/tests/doc/out/find_2.6.12 new file mode 100644 index 00000000..77a18f4e --- /dev/null +++ b/src/go/tests/doc/out/find_2.6.12 @@ -0,0 +1,67 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "k" : 1 + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 2, + "nscannedObjects" : 2, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(213), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(38), + "w" : NumberLong(3) + } + }, + "nreturned" : 2, + "responseLength" : 86, + "millis" : 0, + "execStats" : { + "type" : "FETCH", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "alreadyHasObj" : 0, + "forcedFetches" : 0, + "matchTested" : 0, + "children" : [ + { + "type" : "IXSCAN", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "keyPattern" : "{ k: 1.0 }", + "isMultiKey" : 0, + "boundsVerbose" : "field #0['k']: [1.0, 1.0]", + "yieldMovedCursor" : 0, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0, + "keysExamined" : 2, + "children" : [ ] + } + ] + }, + "ts" : ISODate("2017-10-15T01:54:10.277Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.0.15 b/src/go/tests/doc/out/find_3.0.15 new file mode 100644 index 00000000..17470b31 --- /dev/null +++ b/src/go/tests/doc/out/find_3.0.15 @@ -0,0 +1,87 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "k" : 1 + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 2, + "nscannedObjects" : 2, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 86, + "millis" : 0, + "execStats" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "k" : 1 + }, + "indexName" : "k_1", + "isMultiKey" : false, + "direction" : "forward", + "indexBounds" : { + "k" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:19.953Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.2.16 b/src/go/tests/doc/out/find_3.2.16 new file mode 100644 index 00000000..dd0ff3c6 --- /dev/null +++ b/src/go/tests/doc/out/find_3.2.16 @@ -0,0 +1,88 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "k" : 1 + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 172, + "protocol" : "op_command", + "millis" : 1, + "execStats" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "k" : 1 + }, + "indexName" : "k_1", + "isMultiKey" : false, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 1, + "direction" : "forward", + "indexBounds" : { + "k" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:33.179Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.4.7 b/src/go/tests/doc/out/find_3.4.7 new file mode 100644 index 00000000..49d13b7c --- /dev/null +++ b/src/go/tests/doc/out/find_3.4.7 @@ -0,0 +1,92 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "k" : 1 + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 154, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { k: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "k" : 1 + }, + "indexName" : "k_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "k" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "k" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:43.713Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_3.5.11 b/src/go/tests/doc/out/find_3.5.11 new file mode 100644 index 00000000..05790ee6 --- /dev/null +++ b/src/go/tests/doc/out/find_3.5.11 @@ -0,0 +1,93 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + "k" : 1 + }, + "$db" : "test" + }, + "keysExamined" : 2, + "docsExamined" : 2, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 154, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "IXSCAN { k: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "k" : 1 + }, + "indexName" : "k_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "k" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "k" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:54.507Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_2.6.12 b/src/go/tests/doc/out/find_andrii_2.6.12 new file mode 100644 index 00000000..f57c1f0e --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_2.6.12 @@ -0,0 +1,73 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "orderby" : { + "k" : -1 + } + }, + "ntoreturn" : 100, + "ntoskip" : 0, + "nscanned" : 0, + "nscannedObjects" : 0, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(298), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(5), + "w" : NumberLong(50) + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:10.474Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.0.15 b/src/go/tests/doc/out/find_andrii_3.0.15 new file mode 100644 index 00000000..b4f9de3b --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.0.15 @@ -0,0 +1,96 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "orderby" : { + "k" : -1 + } + }, + "ntoreturn" : 100, + "ntoskip" : 0, + "nscanned" : 0, + "nscannedObjects" : 0, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:20.111Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.2.16 b/src/go/tests/doc/out/find_andrii_3.2.16 new file mode 100644 index 00000000..e567fa74 --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.2.16 @@ -0,0 +1,94 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "limit" : 100, + "singleBatch" : false, + "sort" : { + "k" : -1 + } + }, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 100, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 0, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:33.358Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.4.7 b/src/go/tests/doc/out/find_andrii_3.4.7 new file mode 100644 index 00000000..ff5b6654 --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.4.7 @@ -0,0 +1,94 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "limit" : 100, + "singleBatch" : false, + "sort" : { + "k" : -1 + } + }, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 82, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "EOF", + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 0, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:43.922Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_andrii_3.5.11 b/src/go/tests/doc/out/find_andrii_3.5.11 new file mode 100644 index 00000000..d5d08a79 --- /dev/null +++ b/src/go/tests/doc/out/find_andrii_3.5.11 @@ -0,0 +1,95 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + "$and" : [ + { + "k" : { + "$gt" : 1 + } + }, + { + "k" : { + "$lt" : 2 + } + }, + { + "$or" : [ + { + "c" : { + "$in" : [ + /^0/, + /^2/, + /^4/, + /^6/ + ] + } + }, + { + "pad" : { + "$in" : [ + /9$/, + /7$/, + /5$/, + /3$/ + ] + } + } + ] + } + ] + }, + "limit" : 100, + "singleBatch" : false, + "sort" : { + "k" : -1 + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 82, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "EOF", + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 0, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:54.693Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_2.6.12 b/src/go/tests/doc/out/find_empty_2.6.12 new file mode 100644 index 00000000..06b76808 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_2.6.12 @@ -0,0 +1,33 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 0, + "nscannedObjects" : 0, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(189), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(14), + "w" : NumberLong(9) + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:10.630Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.0.15 b/src/go/tests/doc/out/find_empty_3.0.15 new file mode 100644 index 00000000..4a05a498 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.0.15 @@ -0,0 +1,56 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 0, + "nscannedObjects" : 0, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:20.246Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.2.16 b/src/go/tests/doc/out/find_empty_3.2.16 new file mode 100644 index 00000000..9e06bc47 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.2.16 @@ -0,0 +1,54 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + + } + }, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 100, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 0, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:33.530Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.4.7 b/src/go/tests/doc/out/find_empty_3.4.7 new file mode 100644 index 00000000..770d2211 --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.4.7 @@ -0,0 +1,54 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + + } + }, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 82, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "EOF", + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 0, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:44.129Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_empty_3.5.11 b/src/go/tests/doc/out/find_empty_3.5.11 new file mode 100644 index 00000000..a7f5aa4e --- /dev/null +++ b/src/go/tests/doc/out/find_empty_3.5.11 @@ -0,0 +1,55 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 82, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "EOF", + "execStats" : { + "stage" : "EOF", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 0, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0 + }, + "ts" : ISODate("2017-10-15T01:54:54.870Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_2.6.12 b/src/go/tests/doc/out/find_with_sort_2.6.12 new file mode 100644 index 00000000..241ed57f --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_2.6.12 @@ -0,0 +1,102 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "c" : 1 + }, + "orderby" : { + "b" : -1 + } + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 2, + "nscannedObjects" : 2, + "scanAndOrder" : true, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(508), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(19), + "w" : NumberLong(38) + } + }, + "nreturned" : 2, + "responseLength" : 108, + "millis" : 0, + "execStats" : { + "type" : "SORT", + "works" : 7, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 3, + "needFetch" : 0, + "isEOF" : 1, + "forcedFetches" : 0, + "memUsage" : 104, + "memLimit" : 33554432, + "children" : [ + { + "type" : "KEEP_MUTATIONS", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "children" : [ + { + "type" : "FETCH", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "alreadyHasObj" : 0, + "forcedFetches" : 0, + "matchTested" : 0, + "children" : [ + { + "type" : "IXSCAN", + "works" : 3, + "yields" : 0, + "unyields" : 0, + "invalidates" : 0, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "isEOF" : 1, + "keyPattern" : "{ c: 1.0 }", + "isMultiKey" : 0, + "boundsVerbose" : "field #0['c']: [1.0, 1.0]", + "yieldMovedCursor" : 0, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0, + "keysExamined" : 2, + "children" : [ ] + } + ] + } + ] + } + ] + }, + "ts" : ISODate("2017-10-15T01:54:10.817Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.0.15 b/src/go/tests/doc/out/find_with_sort_3.0.15 new file mode 100644 index 00000000..78dd4c31 --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.0.15 @@ -0,0 +1,124 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "query" : { + "c" : 1 + }, + "orderby" : { + "b" : -1 + } + }, + "ntoreturn" : 0, + "ntoskip" : 0, + "nscanned" : 2, + "nscannedObjects" : 2, + "scanAndOrder" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 108, + "millis" : 0, + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 3, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "KEEP_MUTATIONS", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needFetch" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0, + "matchTested" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:20.410Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.2.16 b/src/go/tests/doc/out/find_with_sort_3.2.16 new file mode 100644 index 00000000..7f03c790 --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.2.16 @@ -0,0 +1,123 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "c" : 1 + }, + "sort" : { + "b" : -1 + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "hasSortStage" : true, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 194, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 1, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:33.762Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.4.7 b/src/go/tests/doc/out/find_with_sort_3.4.7 new file mode 100644 index 00000000..483ff0b2 --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.4.7 @@ -0,0 +1,127 @@ +{ + "op" : "query", + "ns" : "test.coll", + "query" : { + "find" : "coll", + "filter" : { + "c" : 1 + }, + "sort" : { + "b" : -1 + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "hasSortStage" : true, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 176, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { c: 1 }", + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 2, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "c" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:44.423Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/find_with_sort_3.5.11 b/src/go/tests/doc/out/find_with_sort_3.5.11 new file mode 100644 index 00000000..4f9a85cc --- /dev/null +++ b/src/go/tests/doc/out/find_with_sort_3.5.11 @@ -0,0 +1,128 @@ +{ + "op" : "query", + "ns" : "test.coll", + "command" : { + "find" : "coll", + "filter" : { + "c" : 1 + }, + "sort" : { + "b" : -1 + }, + "$db" : "test" + }, + "keysExamined" : 2, + "docsExamined" : 2, + "hasSortStage" : true, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 176, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "IXSCAN { c: 1 }", + "execStats" : { + "stage" : "SORT", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 7, + "advanced" : 2, + "needTime" : 4, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "sortPattern" : { + "b" : -1 + }, + "memUsage" : 104, + "memLimit" : 33554432, + "inputStage" : { + "stage" : "SORT_KEY_GENERATOR", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 2, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "c" : 1 + }, + "indexName" : "c_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "c" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "c" : [ + "[1.0, 1.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + } + }, + "ts" : ISODate("2017-10-15T01:54:55.111Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_2.6.12 b/src/go/tests/doc/out/findandmodify_2.6.12 new file mode 100644 index 00000000..51329dd4 --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_2.6.12 @@ -0,0 +1,45 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(465) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(18) + } + }, + "responseLength" : 131, + "millis" : 6, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:11.011Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.0.15 b/src/go/tests/doc/out/findandmodify_3.0.15 new file mode 100644 index 00000000..86d0d71f --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.0.15 @@ -0,0 +1,59 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 131, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:20.581Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.2.16 b/src/go/tests/doc/out/findandmodify_3.2.16 new file mode 100644 index 00000000..a418ac52 --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.2.16 @@ -0,0 +1,55 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "keysExamined" : 0, + "docsExamined" : 3, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 116, + "protocol" : "op_command", + "millis" : 1, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:34.011Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.4.7 b/src/go/tests/doc/out/findandmodify_3.4.7 new file mode 100644 index 00000000..6a75f883 --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.4.7 @@ -0,0 +1,92 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + } + }, + "updateobj" : { + "$inc" : { + "b" : 1 + } + }, + "keysExamined" : 0, + "docsExamined" : 3, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 116, + "protocol" : "op_command", + "millis" : 1, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$eq" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 3 + } + }, + "ts" : ISODate("2017-10-15T01:54:44.656Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/findandmodify_3.5.11 b/src/go/tests/doc/out/findandmodify_3.5.11 new file mode 100644 index 00000000..728a8f43 --- /dev/null +++ b/src/go/tests/doc/out/findandmodify_3.5.11 @@ -0,0 +1,88 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "findandmodify" : "coll", + "query" : { + "a" : 2 + }, + "update" : { + "$inc" : { + "b" : 1 + } + }, + "$db" : "test" + }, + "keysExamined" : 0, + "docsExamined" : 3, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "responseLength" : 116, + "protocol" : "op_msg", + "millis" : 1, + "planSummary" : "COLLSCAN", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "COLLSCAN", + "filter" : { + "a" : { + "$eq" : 2 + } + }, + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "direction" : "forward", + "docsExamined" : 3 + } + }, + "ts" : ISODate("2017-10-15T01:54:55.391Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_2.6.12 b/src/go/tests/doc/out/geonear_2.6.12 new file mode 100644 index 00000000..d87925c5 --- /dev/null +++ b/src/go/tests/doc/out/geonear_2.6.12 @@ -0,0 +1,36 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(1945), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(10), + "w" : NumberLong(10) + } + }, + "responseLength" : 1406, + "millis" : 1, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:11.181Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.0.15 b/src/go/tests/doc/out/geonear_3.0.15 new file mode 100644 index 00000000..234e7389 --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.0.15 @@ -0,0 +1,49 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "responseLength" : 1398, + "millis" : 2, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:20.751Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.2.16 b/src/go/tests/doc/out/geonear_3.2.16 new file mode 100644 index 00000000..72c8f711 --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.2.16 @@ -0,0 +1,45 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2) + } + } + }, + "responseLength" : 1401, + "protocol" : "op_command", + "millis" : 10, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:34.270Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.4.7 b/src/go/tests/doc/out/geonear_3.4.7 new file mode 100644 index 00000000..7892287e --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.4.7 @@ -0,0 +1,3565 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true + }, + "keysExamined" : 82, + "docsExamined" : 10, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2) + } + } + }, + "responseLength" : 1383, + "protocol" : "op_command", + "millis" : 13, + "planSummary" : "GEO_NEAR_2DSPHERE { loc: \"2dsphere\" }", + "execStats" : { + "stage" : "LIMIT", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "limitAmount" : 100, + "inputStage" : { + "stage" : "PROJECTION", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "transformBy" : { + "$pt" : { + "$meta" : "geoNearPoint" + }, + "$dis" : { + "$meta" : "geoNearDistance" + } + }, + "inputStage" : { + "stage" : "GEO_NEAR_2DSPHERE", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "indexVersion" : 2, + "searchIntervals" : [ + { + "minDistance" : 0, + "maxDistance" : 3.3284465774864755, + "maxInclusive" : false, + "nBuffered" : 1, + "nReturned" : 1 + }, + { + "minDistance" : 3.3284465774864755, + "maxDistance" : 9.985339732459426, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 9.985339732459426, + "maxDistance" : 23.299126042405327, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 23.299126042405327, + "maxDistance" : 49.92669866229713, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 49.92669866229713, + "maxDistance" : 103.18184390208074, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 103.18184390208074, + "maxDistance" : 209.69213438164797, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 209.69213438164797, + "maxDistance" : 422.71271534078244, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 422.71271534078244, + "maxDistance" : 848.7538772590513, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 848.7538772590513, + "maxDistance" : 1700.8362010955889, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 1700.8362010955889, + "maxDistance" : 3405.0008487686646, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3405.0008487686646, + "maxDistance" : 6813.330144114816, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6813.330144114816, + "maxDistance" : 13629.988734807117, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13629.988734807117, + "maxDistance" : 27263.30591619172, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 27263.30591619172, + "maxDistance" : 54529.94027896093, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 54529.94027896093, + "maxDistance" : 109063.20900449934, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 109063.20900449934, + "maxDistance" : 218129.74645557615, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 2 + }, + { + "minDistance" : 218129.74645557615, + "maxDistance" : 436262.82135772984, + "maxInclusive" : false, + "nBuffered" : 3, + "nReturned" : 1 + }, + { + "minDistance" : 436262.82135772984, + "maxDistance" : 872528.9711620372, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 872528.9711620372, + "maxDistance" : 1745061.2707706518, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 1745061.2707706518, + "maxDistance" : 3490125.869987881, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3490125.869987881, + "maxDistance" : 6980255.06842234, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6980255.06842234, + "maxDistance" : 13960513.465291258, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13960513.465291258, + "maxDistance" : 20037392.10386106, + "maxInclusive" : true, + "nBuffered" : 0, + "nReturned" : 0 + } + ], + "inputStages" : [ + { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837631979521, 1153277837632012287]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837633421313, 1153277837633454079]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633454081, 1153277837633486847]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633617921, 1153277837633650687]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837633650689, 1153277837633781759]", + "[1153277837633781761, 1153277837633912831]", + "[1153277837633912833, 1153277837634043903]", + "[1153277837634043905, 1153277837634076671]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634142209, 1153277837634174975]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634371585, 1153277837634404351]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837650198529, 1153277837650231295]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650231297, 1153277837650264063]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837650427905, 1153277837650558975]", + "[1153277837650558977, 1153277837650690047]", + "[1153277837650690049, 1153277837651214335]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652557825, 1153277837652590591]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652590593, 1153277837652623359]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837626048513, 1153277837626572799]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626703873, 1153277837626834943]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629849601, 1153277837629980671]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837631291393, 1153277837631815679]", + "[1153277837631815681, 1153277837631946751]", + "[1153277837631946753, 1153277837631979519]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632012289, 1153277837632045055]", + "[1153277837632045057, 1153277837632077823]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632077825, 1153277837632208895]", + "[1153277837632208897, 1153277837632339967]", + "[1153277837632339969, 1153277837632864255]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837632864257, 1153277837633388543]", + "[1153277837633388545, 1153277837633421311]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633486849, 1153277837633519615]", + "[1153277837633519617, 1153277837633552383]", + "[1153277837633552385, 1153277837633585151]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633585153, 1153277837633617919]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837634076673, 1153277837634109439]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634109441, 1153277837634142207]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634174977, 1153277837634306047]", + "[1153277837634306049, 1153277837634338815]", + "[1153277837634338817, 1153277837634371583]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634404353, 1153277837634437119]", + "[1153277837634437121, 1153277837634961407]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837634961409, 1153277837635485695]", + "[1153277837635485697, 1153277837636009983]", + "[1153277837636009985, 1153277837636141055]", + "[1153277837636141057, 1153277837636272127]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641252865, 1153277837641777151]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642825729, 1153277837643350015]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643513857, 1153277837643546623]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646626817, 1153277837646757887]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837648068609, 1153277837648592895]", + "[1153277837648592897, 1153277837649117183]", + "[1153277837649117185, 1153277837649641471]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837649641473, 1153277837650165759]", + "[1153277837650165761, 1153277837650198527]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650264065, 1153277837650296831]", + "[1153277837650296833, 1153277837650427903]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837651214337, 1153277837651738623]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837651738625, 1153277837652262911]", + "[1153277837652262913, 1153277837652393983]", + "[1153277837652393985, 1153277837652525055]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652525057, 1153277837652557823]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652623361, 1153277837652656127]", + "[1153277837652656129, 1153277837652787199]", + "[1153277837652787201, 1153277837653311487]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837654360065, 1153277837654884351]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657702401, 1153277837657735167]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657767937, 1153277837657899007]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658030081, 1153277837658554367]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836925075457, 1153277836927172607]", + "[1153277836927172609, 1153277836929269759]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837518569473, 1153277837520666623]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837520666625, 1153277837522763775]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837610844161, 1153277837612941311]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837612941313, 1153277837615038463]", + "[1153277837617135617, 1153277837625524223]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837625524225, 1153277837626048511]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626572801, 1153277837626703871]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837626834945, 1153277837626966015]", + "[1153277837626966017, 1153277837627097087]", + "[1153277837627097089, 1153277837627621375]", + "[1153277837627621377, 1153277837629718527]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629718529, 1153277837629849599]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837629980673, 1153277837630111743]", + "[1153277837630111745, 1153277837630242815]", + "[1153277837630242817, 1153277837630767103]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837630767105, 1153277837631291391]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837636272129, 1153277837636403199]", + "[1153277837636403201, 1153277837636534271]", + "[1153277837636534273, 1153277837637058559]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837637058561, 1153277837637582847]", + "[1153277837637582849, 1153277837638107135]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837638107137, 1153277837640204287]", + "[1153277837640204289, 1153277837640728575]", + "[1153277837640728577, 1153277837641252863]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641777153, 1153277837642301439]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642301441, 1153277837642825727]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643350017, 1153277837643481087]", + "[1153277837643481089, 1153277837643513855]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643546625, 1153277837643579391]", + "[1153277837643579393, 1153277837643612159]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837643612161, 1153277837643743231]", + "[1153277837643743233, 1153277837643874303]", + "[1153277837643874305, 1153277837644398591]", + "[1153277837644398593, 1153277837646495743]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646495745, 1153277837646626815]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837646757889, 1153277837646888959]", + "[1153277837646888961, 1153277837647020031]", + "[1153277837647020033, 1153277837647544319]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837647544321, 1153277837648068607]", + "[1153277837653311489, 1153277837653835775]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837653835777, 1153277837654360063]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837654884353, 1153277837656981503]", + "[1153277837656981505, 1153277837657505791]", + "[1153277837657505793, 1153277837657636863]", + "[1153277837657636865, 1153277837657669631]", + "[1153277837657669633, 1153277837657702399]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657735169, 1153277837657767935]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657899009, 1153277837658030079]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658554369, 1153277837659078655]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837659078657, 1153277837661175807]", + "[1153277837661175809, 1153277837663272959]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837669564417, 1153277837671661567]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837671661569, 1153277837673758719]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756858369, 1153277837756989439]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837761839105, 1153277837763936255]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837763936257, 1153277837766033407]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838355333121, 1153277838357430271]", + "[1153277838357430273, 1153277838359527423]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836904103937, 1153277836912492543]", + "[1153277836912492545, 1153277836920881151]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836920881153, 1153277836922978303]", + "[1153277836922978305, 1153277836925075455]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836929269761, 1153277836937658367]", + "[1153277836937658369, 1153277836946046975]", + "[1153277836946046977, 1153277836946571263]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836954435584, 1153277836954435584]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837500383233, 1153277837500415999]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837505986561, 1153277837508083711]", + "[1153277837508083713, 1153277837516472319]", + "[1153277837516472321, 1153277837518569471]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837522763777, 1153277837524860927]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837524860929, 1153277837533249535]", + "[1153277837533249537, 1153277837541638143]", + "[1153277837543735297, 1153277837545832447]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837566803969, 1153277837575192575]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837575192577, 1153277837583581183]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837600358401, 1153277837608747007]", + "[1153277837608747009, 1153277837610844159]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837615038465, 1153277837617135615]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837663272961, 1153277837665370111]", + "[1153277837665370113, 1153277837667467263]", + "[1153277837667467265, 1153277837669564415]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837673758721, 1153277837675855871]", + "[1153277837675855873, 1153277837709410303]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837709410305, 1153277837717798911]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837738770433, 1153277837740867583]", + "[1153277837742964737, 1153277837751353343]", + "[1153277837751353345, 1153277837753450495]", + "[1153277837753450497, 1153277837755547647]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837755547649, 1153277837756071935]", + "[1153277837756071937, 1153277837756596223]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756596225, 1153277837756727295]", + "[1153277837756727297, 1153277837756858367]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756989441, 1153277837757120511]", + "[1153277837757120513, 1153277837757644799]", + "[1153277837757644801, 1153277837759741951]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837759741953, 1153277837761839103]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837766033409, 1153277837768130559]", + "[1153277837768130561, 1153277837776519167]", + "[1153277837776519169, 1153277837784907775]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838338031617, 1153277838338555903]", + "[1153277838338555905, 1153277838346944511]", + "[1153277838346944513, 1153277838355333119]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838359527425, 1153277838361624575]", + "[1153277838361624577, 1153277838363721727]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838363721729, 1153277838372110335]", + "[1153277838372110337, 1153277838380498943]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836769886209, 1153277836803440639]", + "[1153277836803440641, 1153277836836995071]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836836995073, 1153277836870549503]", + "[1153277836870549505, 1153277836904103935]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836946571265, 1153277836947095551]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836947095553, 1153277836947619839]", + "[1153277836947619841, 1153277836948144127]", + "[1153277836948144129, 1153277836950241279]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836950241281, 1153277836952338431]", + "[1153277836952338433, 1153277836954435583]", + "[1153277836954435584, 1153277836954435584]", + "[1153277836954435585, 1153277836962824191]", + "[1153277836962824193, 1153277836971212799]", + "[1153277836971212801, 1153277837004767231]", + "[1153277837004767233, 1153277837038321663]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837092847617, 1153277837094944767]", + "[1153277837105430529, 1153277837239648255]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837340311553, 1153277837373865983]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837373865985, 1153277837407420415]", + "[1153277837407420417, 1153277837440974847]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837440974849, 1153277837474529279]", + "[1153277837474529281, 1153277837482917887]", + "[1153277837482917889, 1153277837491306495]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837491306497, 1153277837499695103]", + "[1153277837499695105, 1153277837500219391]", + "[1153277837500219393, 1153277837500350463]", + "[1153277837500350465, 1153277837500383231]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500416001, 1153277837500448767]", + "[1153277837500448769, 1153277837500481535]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500481537, 1153277837500612607]", + "[1153277837500612609, 1153277837500743679]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837500743681, 1153277837501267967]", + "[1153277837501267969, 1153277837501792255]", + "[1153277837501792257, 1153277837503889407]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837503889409, 1153277837505986559]", + "[1153277837541638145, 1153277837543735295]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837545832449, 1153277837547929599]", + "[1153277837547929601, 1153277837550026751]", + "[1153277837550026753, 1153277837558415359]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837558415361, 1153277837566803967]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837583581185, 1153277837591969791]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837591969793, 1153277837600358399]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837717798913, 1153277837726187519]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837726187521, 1153277837734576127]", + "[1153277837734576129, 1153277837736673279]", + "[1153277837736673281, 1153277837738770431]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837740867585, 1153277837742964735]", + "[1153277837784907777, 1153277837793296383]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837793296385, 1153277837801684991]", + "[1153277837801684993, 1153277837810073599]", + "[1153277837810073601, 1153277837843628031]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837843628033, 1153277837877182463]", + "[1153277837877182465, 1153277837910736895]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837910736897, 1153277837944291327]", + "[1153277837977845760, 1153277837977845760]", + "[1153277838044954625, 1153277838179172351]", + "[1153277838179172353, 1153277838313390079]", + "[1153277838313390081, 1153277838321778687]", + "[1153277838321778689, 1153277838330167295]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838330167297, 1153277838332264447]", + "[1153277838332264449, 1153277838334361599]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838334361601, 1153277838336458751]", + "[1153277838336458753, 1153277838336983039]", + "[1153277838336983041, 1153277838337507327]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838337507329, 1153277838338031615]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838380498945, 1153277838414053375]", + "[1153277838414053377, 1153277838447607807]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838447607809, 1153277838481162239]", + "[1153277838481162241, 1153277838514716671]", + "[1153277838514716672, 1153277838514716672]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833699655681, 1153277833708044287]", + "[1153277835494817792, 1153277835494817792]", + "[1153277835494817793, 1153277836031688703]", + "[1153277836031688705, 1153277836165906431]", + "[1153277836165906433, 1153277836300124159]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836434341889, 1153277836568559615]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836568559617, 1153277836702777343]", + "[1153277836702777345, 1153277836736331775]", + "[1153277836736331777, 1153277836769886207]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836836995072, 1153277836836995072]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837038321665, 1153277837071876095]", + "[1153277837071876097, 1153277837080264703]", + "[1153277837080264705, 1153277837088653311]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837088653313, 1153277837090750463]", + "[1153277837090750465, 1153277837092847615]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837094944769, 1153277837097041919]", + "[1153277837097041921, 1153277837105430527]", + "[1153277837239648257, 1153277837273202687]", + "[1153277837273202689, 1153277837306757119]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837306757121, 1153277837340311551]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837944291329, 1153277837977845759]", + "[1153277837977845760, 1153277837977845760]", + "[1153277837977845761, 1153277838011400191]", + "[1153277838011400193, 1153277838044954623]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838514716672, 1153277838514716672]", + "[1153277838514716673, 1153277838548271103]", + "[1153277838548271105, 1153277838581825535]", + "[1153277838581825537, 1153277838716043263]", + "[1153277838716043265, 1153277838850260991]", + "[1153277838984478720, 1153277838984478720]", + "[1153277839118696449, 1153277839252914175]", + "[1153277839252914177, 1153277839387131903]", + "[1153277839387131905, 1153277839521349631]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839789785088, 1153277839789785088]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278013375250433, 1153278013383639039]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013735960576, 1153278013735960576]", + "[1153278016957186048, 1153278016957186048]", + "[1153278020178411520, 1153278020178411520]", + "[1153278020178411521, 1153278020715282431]", + "[1153278020715282433, 1153278021252153343]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021252153345, 1153278021386371071]", + "[1153278021520588800, 1153278021520588800]", + "[1153278022325895168, 1153278022325895168]", + "[1153278025547120640, 1153278025547120640]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278204325134337, 1153278204862005247]", + "[1153278204862005248, 1153278204862005248]", + "[1153278204862005249, 1153278205398876159]", + "[1153278205935747072, 1153278205935747072]", + "[1153278206606835713, 1153278206741053439]", + "[1153278206741053440, 1153278206741053440]", + "[1153278207009488896, 1153278207009488896]", + "[1153278210230714368, 1153278210230714368]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277827978625024, 1153277827978625024]", + "[1153277829052366848, 1153277829052366848]", + "[1153277829052366849, 1153277829589237759]", + "[1153277829589237761, 1153277830126108671]", + "[1153277832273592320, 1153277832273592320]", + "[1153277832273592321, 1153277832810463231]", + "[1153277832810463233, 1153277833347334143]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833347334145, 1153277833481551871]", + "[1153277833481551873, 1153277833615769599]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833615769601, 1153277833649324031]", + "[1153277833649324033, 1153277833682878463]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833682878465, 1153277833691267071]", + "[1153277833691267073, 1153277833699655679]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833708044289, 1153277833716432895]", + "[1153277833716432897, 1153277833749987327]", + "[1153277833749987329, 1153277833884205055]", + "[1153277833884205057, 1153277834421075967]", + "[1153277834421075969, 1153277834957946879]", + "[1153277834957946881, 1153277835494817791]", + "[1153277835494817792, 1153277835494817792]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836300124161, 1153277836434341887]", + "[1153277836568559616, 1153277836568559616]", + "[1153277838850260993, 1153277838984478719]", + "[1153277838984478720, 1153277838984478720]", + "[1153277838984478721, 1153277839118696447]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839521349633, 1153277839655567359]", + "[1153277839655567361, 1153277839789785087]", + "[1153277839789785088, 1153277839789785088]", + "[1153277839789785089, 1153277840326655999]", + "[1153277840326656001, 1153277840863526911]", + "[1153277840863526913, 1153277841400397823]", + "[1153277841937268736, 1153277841937268736]", + "[1153277842474139649, 1153277843011010559]", + "[1153277845158494208, 1153277845158494208]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278012662218753, 1153278013199089663]", + "[1153278013199089665, 1153278013333307391]", + "[1153278013333307393, 1153278013366861823]", + "[1153278013366861825, 1153278013375250431]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013383639041, 1153278013392027647]", + "[1153278013392027649, 1153278013400416255]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013400416257, 1153278013433970687]", + "[1153278013433970689, 1153278013467525119]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013467525121, 1153278013601742847]", + "[1153278013601742849, 1153278013735960575]", + "[1153278013735960576, 1153278013735960576]", + "[1153278013735960577, 1153278014272831487]", + "[1153278014272831489, 1153278014809702399]", + "[1153278016957186048, 1153278016957186048]", + "[1153278016957186049, 1153278017494056959]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018567798785, 1153278019104669695]", + "[1153278019104669697, 1153278019641540607]", + "[1153278019641540609, 1153278020178411519]", + "[1153278020178411520, 1153278020178411520]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021386371073, 1153278021520588799]", + "[1153278021520588800, 1153278021520588800]", + "[1153278021520588801, 1153278021654806527]", + "[1153278021654806529, 1153278021789024255]", + "[1153278021789024257, 1153278022325895167]", + "[1153278022325895168, 1153278022325895168]", + "[1153278022325895169, 1153278022862766079]", + "[1153278022862766081, 1153278023399636991]", + "[1153278023399636993, 1153278023433191423]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023668072448, 1153278023668072448]", + "[1153278024473378816, 1153278024473378816]", + "[1153278025547120640, 1153278025547120640]", + "[1153278028768346112, 1153278028768346112]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029036781569, 1153278029170999295]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278202714521600, 1153278202714521600]", + "[1153278202714521601, 1153278203251392511]", + "[1153278203251392513, 1153278203788263423]", + "[1153278203788263425, 1153278204325134335]", + "[1153278204862005248, 1153278204862005248]", + "[1153278205398876161, 1153278205935747071]", + "[1153278205935747072, 1153278205935747072]", + "[1153278205935747073, 1153278206472617983]", + "[1153278206472617985, 1153278206606835711]", + "[1153278206741053440, 1153278206741053440]", + "[1153278206741053441, 1153278206875271167]", + "[1153278206875271169, 1153278207009488895]", + "[1153278207009488896, 1153278207009488896]", + "[1153278207009488897, 1153278207546359807]", + "[1153278207546359809, 1153278208083230719]", + "[1153278208754319361, 1153278208888537087]", + "[1153278208888537088, 1153278208888537088]", + "[1153278209156972544, 1153278209156972544]", + "[1153278210230714368, 1153278210230714368]", + "[1153278213082841089, 1153278213116395519]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213451939840, 1153278213451939840]", + "[1153278214525681664, 1153278214525681664]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277815093723137, 1153277823683657727]", + "[1153277823683657729, 1153277825831141375]", + "[1153277825831141377, 1153277827978625023]", + "[1153277827978625024, 1153277827978625024]", + "[1153277827978625025, 1153277828515495935]", + "[1153277828515495937, 1153277829052366847]", + "[1153277829052366848, 1153277829052366848]", + "[1153277830126108673, 1153277832273592319]", + "[1153277832273592320, 1153277832273592320]", + "[1153277841400397825, 1153277841937268735]", + "[1153277841937268736, 1153277841937268736]", + "[1153277841937268737, 1153277842474139647]", + "[1153277843011010561, 1153277845158494207]", + "[1153277845158494208, 1153277845158494208]", + "[1153277845158494209, 1153277847305977855]", + "[1153277847305977857, 1153277849453461503]", + "[1153277952532676608, 1153277952532676608]", + "[1153277989039898625, 1153277991187382271]", + "[1153277991187382272, 1153277991187382272]", + "[1153277991187382273, 1153277993334865919]", + "[1153277999777316864, 1153277999777316864]", + "[1153278002998542336, 1153278002998542336]", + "[1153278003535413249, 1153278004072284159]", + "[1153278004072284160, 1153278004072284160]", + "[1153278004072284161, 1153278012662218751]", + "[1153278014809702401, 1153278016957186047]", + "[1153278016957186048, 1153278016957186048]", + "[1153278017494056961, 1153278018030927871]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018030927873, 1153278018567798783]", + "[1153278021252153344, 1153278021252153344]", + "[1153278023433191425, 1153278023466745855]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023466745857, 1153278023500300287]", + "[1153278023500300289, 1153278023533854719]", + "[1153278023533854721, 1153278023668072447]", + "[1153278023668072448, 1153278023668072448]", + "[1153278023668072449, 1153278023802290175]", + "[1153278023802290177, 1153278023936507903]", + "[1153278023936507905, 1153278024473378815]", + "[1153278024473378816, 1153278024473378816]", + "[1153278024473378817, 1153278025010249727]", + "[1153278025010249729, 1153278025547120639]", + "[1153278025547120640, 1153278025547120640]", + "[1153278025547120641, 1153278027694604287]", + "[1153278027694604289, 1153278028231475199]", + "[1153278028231475201, 1153278028768346111]", + "[1153278028768346112, 1153278028768346112]", + "[1153278028768346113, 1153278028902563839]", + "[1153278028902563841, 1153278029036781567]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029170999297, 1153278029305217023]", + "[1153278029305217025, 1153278029842087935]", + "[1153278029842087937, 1153278031989571583]", + "[1153278034137055232, 1153278034137055232]", + "[1153278036284538881, 1153278038432022527]", + "[1153278038432022528, 1153278038432022528]", + "[1153278049974747136, 1153278049974747136]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050058633217, 1153278050067021823]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050243182593, 1153278050780053503]", + "[1153278051316924416, 1153278051316924416]", + "[1153278051316924417, 1153278053464408063]", + "[1153278089971630080, 1153278089971630080]", + "[1153278197345812480, 1153278197345812480]", + "[1153278197345812481, 1153278199493296127]", + "[1153278199493296129, 1153278201640779775]", + "[1153278201640779777, 1153278202177650687]", + "[1153278202177650689, 1153278202714521599]", + "[1153278202714521600, 1153278202714521600]", + "[1153278205935747072, 1153278205935747072]", + "[1153278208083230721, 1153278208620101631]", + "[1153278208620101633, 1153278208754319359]", + "[1153278208888537088, 1153278208888537088]", + "[1153278208888537089, 1153278209022754815]", + "[1153278209022754817, 1153278209156972543]", + "[1153278209156972544, 1153278209156972544]", + "[1153278209156972545, 1153278209693843455]", + "[1153278209693843457, 1153278210230714367]", + "[1153278210230714368, 1153278210230714368]", + "[1153278210230714369, 1153278212378198015]", + "[1153278212378198017, 1153278212915068927]", + "[1153278212915068929, 1153278213049286655]", + "[1153278213049286657, 1153278213082841087]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213116395521, 1153278213149949951]", + "[1153278213149949953, 1153278213183504383]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213183504385, 1153278213317722111]", + "[1153278213317722113, 1153278213451939839]", + "[1153278213451939840, 1153278213451939840]", + "[1153278213451939841, 1153278213988810751]", + "[1153278213988810753, 1153278214525681663]", + "[1153278214525681664, 1153278214525681664]", + "[1153278214525681665, 1153278216673165311]", + "[1153278216673165313, 1153278218820648959]", + "[1153278220968132609, 1153278223115616255]", + "[1153278223115616256, 1153278223115616256]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277763554115584, 1153277763554115584]", + "[1153277763554115585, 1153277772144050175]", + "[1153277780733984769, 1153277815093723135]", + "[1153277815093723136, 1153277815093723136]", + "[1153277849453461505, 1153277883813199871]", + "[1153277883813199873, 1153277918172938239]", + "[1153277935352807424, 1153277935352807424]", + "[1153277948237709312, 1153277948237709312]", + "[1153277950385192961, 1153277952532676607]", + "[1153277952532676608, 1153277952532676608]", + "[1153277952532676609, 1153277961122611199]", + "[1153277969712545792, 1153277969712545792]", + "[1153277978302480385, 1153277986892414975]", + "[1153277986892414977, 1153277989039898623]", + "[1153277991187382272, 1153277991187382272]", + "[1153277993334865921, 1153277995482349567]", + "[1153277995482349569, 1153277997629833215]", + "[1153277997629833217, 1153277999777316863]", + "[1153277999777316864, 1153277999777316864]", + "[1153277999777316865, 1153278001924800511]", + "[1153278001924800513, 1153278002461671423]", + "[1153278002461671425, 1153278002998542335]", + "[1153278002998542336, 1153278002998542336]", + "[1153278002998542337, 1153278003535413247]", + "[1153278004072284160, 1153278004072284160]", + "[1153278021252153344, 1153278021252153344]", + "[1153278031989571585, 1153278034137055231]", + "[1153278034137055232, 1153278034137055232]", + "[1153278034137055233, 1153278036284538879]", + "[1153278038432022528, 1153278038432022528]", + "[1153278038432022529, 1153278047021957119]", + "[1153278047021957121, 1153278049169440767]", + "[1153278049169440769, 1153278049706311679]", + "[1153278049706311681, 1153278049840529407]", + "[1153278049840529409, 1153278049974747135]", + "[1153278049974747136, 1153278049974747136]", + "[1153278049974747137, 1153278050008301567]", + "[1153278050008301569, 1153278050041855999]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050041856001, 1153278050050244607]", + "[1153278050050244609, 1153278050058633215]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050067021825, 1153278050075410431]", + "[1153278050075410433, 1153278050108964863]", + "[1153278050108964865, 1153278050243182591]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050780053505, 1153278051316924415]", + "[1153278051316924416, 1153278051316924416]", + "[1153278053464408065, 1153278055611891711]", + "[1153278055611891713, 1153278064201826303]", + "[1153278072791760896, 1153278072791760896]", + "[1153278081381695489, 1153278089971630079]", + "[1153278089971630080, 1153278089971630080]", + "[1153278089971630081, 1153278090005184511]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090240065536, 1153278090240065536]", + "[1153278091045371904, 1153278091045371904]", + "[1153278094266597376, 1153278094266597376]", + "[1153278107151499264, 1153278107151499264]", + "[1153278132921303041, 1153278141511237631]", + "[1153278141511237632, 1153278141511237632]", + "[1153278141511237633, 1153278150101172223]", + "[1153278175870976000, 1153278175870976000]", + "[1153278175870976001, 1153278184460910591]", + "[1153278184460910593, 1153278193050845183]", + "[1153278193050845185, 1153278195198328831]", + "[1153278195198328833, 1153278197345812479]", + "[1153278197345812480, 1153278197345812480]", + "[1153278210230714368, 1153278210230714368]", + "[1153278218820648961, 1153278220968132607]", + "[1153278223115616256, 1153278223115616256]", + "[1153278223115616257, 1153278225263099903]", + "[1153278225263099905, 1153278227410583551]", + "[1153278227410583552, 1153278227410583552]", + "[1153278227410583553, 1153278261770321919]", + "[1153278270360256513, 1153278278950191103]", + "[1153278278950191104, 1153278278950191104]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274447839363072, 1153274447839363072]", + "[1153274722717270016, 1153274722717270016]", + "[1153274791436746752, 1153274791436746752]", + "[1153274791436746753, 1153274825796485119]", + "[1153276646862618624, 1153276646862618624]", + "[1153276921740525568, 1153276921740525568]", + "[1153277127898955776, 1153277127898955776]", + "[1153277162258694145, 1153277196618432511]", + "[1153277196618432513, 1153277334057385983]", + "[1153277471496339456, 1153277471496339456]", + "[1153277608935292929, 1153277746374246399]", + "[1153277746374246400, 1153277746374246400]", + "[1153277746374246401, 1153277754964180991]", + "[1153277754964180993, 1153277763554115583]", + "[1153277763554115584, 1153277763554115584]", + "[1153277772144050177, 1153277780733984767]", + "[1153277815093723136, 1153277815093723136]", + "[1153277918172938241, 1153277926762872831]", + "[1153277926762872833, 1153277935352807423]", + "[1153277935352807424, 1153277935352807424]", + "[1153277935352807425, 1153277943942742015]", + "[1153277943942742017, 1153277946090225663]", + "[1153277946090225665, 1153277948237709311]", + "[1153277948237709312, 1153277948237709312]", + "[1153277948237709313, 1153277950385192959]", + "[1153277952532676608, 1153277952532676608]", + "[1153277961122611201, 1153277969712545791]", + "[1153277969712545792, 1153277969712545792]", + "[1153277969712545793, 1153277978302480383]", + "[1153278021252153344, 1153278021252153344]", + "[1153278064201826305, 1153278072791760895]", + "[1153278072791760896, 1153278072791760896]", + "[1153278072791760897, 1153278081381695487]", + "[1153278089971630080, 1153278089971630080]", + "[1153278090005184513, 1153278090038738943]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090038738945, 1153278090072293375]", + "[1153278090072293377, 1153278090105847807]", + "[1153278090105847809, 1153278090240065535]", + "[1153278090240065536, 1153278090240065536]", + "[1153278090240065537, 1153278090374283263]", + "[1153278090374283265, 1153278090508500991]", + "[1153278090508500993, 1153278091045371903]", + "[1153278091045371904, 1153278091045371904]", + "[1153278091045371905, 1153278091582242815]", + "[1153278091582242817, 1153278092119113727]", + "[1153278092119113729, 1153278094266597375]", + "[1153278094266597376, 1153278094266597376]", + "[1153278094266597377, 1153278096414081023]", + "[1153278096414081025, 1153278098561564671]", + "[1153278098561564673, 1153278107151499263]", + "[1153278107151499264, 1153278107151499264]", + "[1153278107151499265, 1153278115741433855]", + "[1153278115741433857, 1153278124331368447]", + "[1153278124331368449, 1153278132921303039]", + "[1153278141511237632, 1153278141511237632]", + "[1153278150101172225, 1153278158691106815]", + "[1153278158691106817, 1153278167281041407]", + "[1153278167281041409, 1153278175870975999]", + "[1153278175870976000, 1153278175870976000]", + "[1153278227410583552, 1153278227410583552]", + "[1153278261770321921, 1153278270360256511]", + "[1153278278950191104, 1153278278950191104]", + "[1153278278950191105, 1153278287540125695]", + "[1153278287540125697, 1153278296130060287]", + "[1153278296130060289, 1153278433569013759]", + "[1153278571007967232, 1153278571007967232]", + "[1153278708446920705, 1153278845885874175]", + "[1153278845885874176, 1153278845885874176]", + "[1153278845885874177, 1153278854475808767]", + "[1153278863065743360, 1153278863065743360]", + "[1153278914605350912, 1153278914605350912]", + "[1153279120763781120, 1153279120763781120]", + "[1153279533080641537, 1153279670519595007]", + "[1153279670519595008, 1153279670519595008]", + "[1153279670519595009, 1153279807958548479]", + "[1153280220275408896, 1153280220275408896]", + "[1153280426433839104, 1153280426433839104]", + "[1153280477973446656, 1153280477973446656]", + "[1153280486563381249, 1153280495153315839]", + "[1153280495153315841, 1153280632592269311]", + "[1153280632592269313, 1153280770031222783]", + "[1153280770031222784, 1153280770031222784]", + "[1153281044909129728, 1153281044909129728]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274172961456128, 1153274172961456128]", + "[1153274241680932864, 1153274241680932864]", + "[1153274241680932865, 1153274276040671231]", + "[1153274447839363072, 1153274447839363072]", + "[1153274447839363073, 1153274585278316543]", + "[1153274585278316545, 1153274722717270015]", + "[1153274722717270016, 1153274722717270016]", + "[1153274722717270017, 1153274757077008383]", + "[1153274757077008385, 1153274791436746751]", + "[1153274791436746752, 1153274791436746752]", + "[1153274825796485121, 1153274860156223487]", + "[1153274860156223489, 1153274997595176959]", + "[1153274997595176961, 1153275031954915327]", + "[1153275066314653696, 1153275066314653696]", + "[1153275272473083904, 1153275272473083904]", + "[1153275684789944321, 1153275822228897791]", + "[1153275822228897792, 1153275822228897792]", + "[1153275822228897793, 1153275959667851263]", + "[1153276371984711680, 1153276371984711680]", + "[1153276578143141888, 1153276578143141888]", + "[1153276629682749440, 1153276629682749440]", + "[1153276638272684033, 1153276646862618623]", + "[1153276646862618624, 1153276646862618624]", + "[1153276646862618625, 1153276784301572095]", + "[1153276784301572097, 1153276921740525567]", + "[1153276921740525568, 1153276921740525568]", + "[1153276921740525569, 1153277059179479039]", + "[1153277059179479041, 1153277093539217407]", + "[1153277093539217409, 1153277127898955775]", + "[1153277127898955776, 1153277127898955776]", + "[1153277127898955777, 1153277162258694143]", + "[1153277334057385985, 1153277471496339455]", + "[1153277471496339456, 1153277471496339456]", + "[1153277471496339457, 1153277608935292927]", + "[1153277746374246400, 1153277746374246400]", + "[1153278433569013761, 1153278571007967231]", + "[1153278571007967232, 1153278571007967232]", + "[1153278571007967233, 1153278708446920703]", + "[1153278845885874176, 1153278845885874176]", + "[1153278854475808769, 1153278863065743359]", + "[1153278863065743360, 1153278863065743360]", + "[1153278863065743361, 1153278871655677951]", + "[1153278871655677953, 1153278880245612543]", + "[1153278880245612545, 1153278914605350911]", + "[1153278914605350912, 1153278914605350912]", + "[1153278914605350913, 1153278948965089279]", + "[1153278948965089281, 1153278983324827647]", + "[1153278983324827649, 1153279120763781119]", + "[1153279120763781120, 1153279120763781120]", + "[1153279120763781121, 1153279258202734591]", + "[1153279258202734593, 1153279395641688063]", + "[1153279395641688065, 1153279533080641535]", + "[1153279670519595008, 1153279670519595008]", + "[1153279807958548481, 1153279945397501951]", + "[1153279945397501953, 1153280082836455423]", + "[1153280082836455425, 1153280220275408895]", + "[1153280220275408896, 1153280220275408896]", + "[1153280220275408897, 1153280357714362367]", + "[1153280357714362369, 1153280392074100735]", + "[1153280392074100737, 1153280426433839103]", + "[1153280426433839104, 1153280426433839104]", + "[1153280426433839105, 1153280460793577471]", + "[1153280460793577473, 1153280469383512063]", + "[1153280469383512065, 1153280477973446655]", + "[1153280477973446656, 1153280477973446656]", + "[1153280477973446657, 1153280486563381247]", + "[1153280770031222784, 1153280770031222784]", + "[1153280770031222785, 1153280907470176255]", + "[1153280907470176257, 1153281044909129727]", + "[1153281044909129728, 1153281044909129728]", + "[1153281044909129729, 1153281182348083199]", + "[1153281182348083201, 1153281319787036671]", + "[1153281319787036672, 1153281319787036672]", + "[1153281775053570049, 1153281783643504639]", + "[1153281783643504640, 1153281783643504640]", + "[1153281800823373824, 1153281800823373824]", + "[1153281869542850560, 1153281869542850560]", + "[1153286542467268608, 1153286542467268608]", + "[1153289841002151936, 1153289841002151936]", + "[1153290115880058880, 1153290115880058880]", + "[1153290115880058881, 1153290253319012351]", + "[1153290253319012353, 1153290390757965823]", + "[1153290940513779712, 1153290940513779712]", + "[1153303035141685248, 1153303035141685248]", + "[1153303035141685249, 1153303584897499135]", + "[1153304134653313024, 1153304134653313024]", + "[1153304867649880065, 1153304867683434495]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867750543360, 1153304867750543360]", + "[1153304868018978816, 1153304868018978816]", + "[1153304869092720640, 1153304869092720640]", + "[1153304873387687936, 1153304873387687936]", + "[1153304890567557120, 1153304890567557120]", + "[1153304959287033856, 1153304959287033856]", + "[1153305234164940800, 1153305234164940800]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153255756141690880, 1153255756141690880]", + "[1153260154188201984, 1153260154188201984]", + "[1153263452723085312, 1153263452723085312]", + "[1153264277356806144, 1153264277356806144]", + "[1153264346076282880, 1153264346076282880]", + "[1153264397615890432, 1153264397615890432]", + "[1153264410500792320, 1153264410500792320]", + "[1153264413722017792, 1153264413722017792]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414787371009, 1153264414795759615]", + "[1153264414795759617, 1153264552234713087]", + "[1153264552234713089, 1153265101990526975]", + "[1153265101990526977, 1153265651746340863]", + "[1153265651746340864, 1153265651746340864]", + "[1153268950281224192, 1153268950281224192]", + "[1153272248816107520, 1153272248816107520]", + "[1153272248816107521, 1153272798571921407]", + "[1153272798571921409, 1153273348327735295]", + "[1153273348327735296, 1153273348327735296]", + "[1153273348327735297, 1153273898083549183]", + "[1153273898083549185, 1153274035522502655]", + "[1153274035522502657, 1153274172961456127]", + "[1153274172961456128, 1153274172961456128]", + "[1153274172961456129, 1153274207321194495]", + "[1153274207321194497, 1153274241680932863]", + "[1153274241680932864, 1153274241680932864]", + "[1153274276040671233, 1153274310400409599]", + "[1153274310400409601, 1153274447839363071]", + "[1153274447839363072, 1153274447839363072]", + "[1153275031954915329, 1153275066314653695]", + "[1153275066314653696, 1153275066314653696]", + "[1153275066314653697, 1153275100674392063]", + "[1153275100674392065, 1153275135034130431]", + "[1153275135034130433, 1153275272473083903]", + "[1153275272473083904, 1153275272473083904]", + "[1153275272473083905, 1153275409912037375]", + "[1153275409912037377, 1153275547350990847]", + "[1153275547350990849, 1153275684789944319]", + "[1153275822228897792, 1153275822228897792]", + "[1153275959667851265, 1153276097106804735]", + "[1153276097106804737, 1153276234545758207]", + "[1153276234545758209, 1153276371984711679]", + "[1153276371984711680, 1153276371984711680]", + "[1153276371984711681, 1153276509423665151]", + "[1153276509423665153, 1153276543783403519]", + "[1153276543783403521, 1153276578143141887]", + "[1153276578143141888, 1153276578143141888]", + "[1153276578143141889, 1153276612502880255]", + "[1153276612502880257, 1153276621092814847]", + "[1153276621092814849, 1153276629682749439]", + "[1153276629682749440, 1153276629682749440]", + "[1153276629682749441, 1153276638272684031]", + "[1153276646862618624, 1153276646862618624]", + "[1153277746374246400, 1153277746374246400]", + "[1153281044909129728, 1153281044909129728]", + "[1153281319787036672, 1153281319787036672]", + "[1153281319787036673, 1153281457225990143]", + "[1153281457225990145, 1153281594664943615]", + "[1153281594664943617, 1153281732103897087]", + "[1153281732103897089, 1153281766463635455]", + "[1153281766463635457, 1153281775053570047]", + "[1153281783643504640, 1153281783643504640]", + "[1153281783643504641, 1153281792233439231]", + "[1153281792233439233, 1153281800823373823]", + "[1153281800823373824, 1153281800823373824]", + "[1153281800823373825, 1153281835183112191]", + "[1153281835183112193, 1153281869542850559]", + "[1153281869542850560, 1153281869542850560]", + "[1153281869542850561, 1153282006981804031]", + "[1153282006981804033, 1153282144420757503]", + "[1153282144420757505, 1153284343444013055]", + "[1153286542467268608, 1153286542467268608]", + "[1153288741490524161, 1153289291246338047]", + "[1153289291246338049, 1153289841002151935]", + "[1153289841002151936, 1153289841002151936]", + "[1153289841002151937, 1153289978441105407]", + "[1153289978441105409, 1153290115880058879]", + "[1153290115880058880, 1153290115880058880]", + "[1153290390757965825, 1153290940513779711]", + "[1153290940513779712, 1153290940513779712]", + "[1153290940513779713, 1153293139537035263]", + "[1153295338560290816, 1153295338560290816]", + "[1153301935630057473, 1153302485385871359]", + "[1153302485385871361, 1153303035141685247]", + "[1153303035141685248, 1153303035141685248]", + "[1153303584897499137, 1153304134653313023]", + "[1153304134653313024, 1153304134653313024]", + "[1153304134653313025, 1153304684409126911]", + "[1153304684409126913, 1153304821848080383]", + "[1153304821848080385, 1153304856207818751]", + "[1153304856207818753, 1153304864797753343]", + "[1153304864797753345, 1153304866945236991]", + "[1153304866945236993, 1153304867482107903]", + "[1153304867482107905, 1153304867616325631]", + "[1153304867616325633, 1153304867649880063]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867683434497, 1153304867716988927]", + "[1153304867716988929, 1153304867750543359]", + "[1153304867750543360, 1153304867750543360]", + "[1153304867750543361, 1153304867884761087]", + "[1153304867884761089, 1153304868018978815]", + "[1153304868018978816, 1153304868018978816]", + "[1153304868018978817, 1153304868555849727]", + "[1153304868555849729, 1153304869092720639]", + "[1153304869092720640, 1153304869092720640]", + "[1153304869092720641, 1153304871240204287]", + "[1153304871240204289, 1153304873387687935]", + "[1153304873387687936, 1153304873387687936]", + "[1153304873387687937, 1153304881977622527]", + "[1153304881977622529, 1153304890567557119]", + "[1153304890567557120, 1153304890567557120]", + "[1153304890567557121, 1153304924927295487]", + "[1153304924927295489, 1153304959287033855]", + "[1153304959287033856, 1153304959287033856]", + "[1153304959287033857, 1153305096725987327]", + "[1153305096725987329, 1153305234164940799]", + "[1153305234164940800, 1153305234164940800]", + "[1153305234164940801, 1153305783920754687]", + "[1153305783920754689, 1153306333676568575]", + "[1153312930746335232, 1153312930746335232]", + "[1153316229281218560, 1153316229281218560]", + "[1153316779037032449, 1153317328792846335]", + "[1153317328792846337, 1153317878548660223]", + "[1153318428304474112, 1153318428304474112]", + "[1153318978060288001, 1153319527816101887]", + "[1153319527816101889, 1153320077571915775]", + "[1153320077571915777, 1153320627327729663]", + "[1153320627327729664, 1153320627327729664]", + "[1153321726839357440, 1153321726839357440]", + "[1153326124885868544, 1153326124885868544]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153220571769602048, 1153220571769602048]", + "[1153220571769602049, 1153229367862624255]", + "[1153255756141690880, 1153255756141690880]", + "[1153255756141690881, 1153257955164946431]", + "[1153257955164946433, 1153260154188201983]", + "[1153260154188201984, 1153260154188201984]", + "[1153260154188201985, 1153262353211457535]", + "[1153262353211457537, 1153262902967271423]", + "[1153262902967271425, 1153263452723085311]", + "[1153263452723085312, 1153263452723085312]", + "[1153263452723085313, 1153264002478899199]", + "[1153264002478899201, 1153264139917852671]", + "[1153264139917852673, 1153264277356806143]", + "[1153264277356806144, 1153264277356806144]", + "[1153264277356806145, 1153264311716544511]", + "[1153264311716544513, 1153264346076282879]", + "[1153264346076282880, 1153264346076282880]", + "[1153264346076282881, 1153264380436021247]", + "[1153264380436021249, 1153264389025955839]", + "[1153264389025955841, 1153264397615890431]", + "[1153264397615890432, 1153264397615890432]", + "[1153264397615890433, 1153264406205825023]", + "[1153264406205825025, 1153264408353308671]", + "[1153264408353308673, 1153264410500792319]", + "[1153264410500792320, 1153264410500792320]", + "[1153264410500792321, 1153264412648275967]", + "[1153264412648275969, 1153264413185146879]", + "[1153264413185146881, 1153264413722017791]", + "[1153264413722017792, 1153264413722017792]", + "[1153264413722017793, 1153264414258888703]", + "[1153264414258888705, 1153264414393106431]", + "[1153264414393106433, 1153264414527324159]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414527324161, 1153264414661541887]", + "[1153264414661541889, 1153264414695096319]", + "[1153264414695096321, 1153264414728650751]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414728650753, 1153264414762205183]", + "[1153264414762205185, 1153264414770593791]", + "[1153264414770593793, 1153264414778982399]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414778982401, 1153264414787371007]", + "[1153265651746340864, 1153265651746340864]", + "[1153265651746340865, 1153266201502154751]", + "[1153266201502154753, 1153266751257968639]", + "[1153266751257968641, 1153268950281224191]", + "[1153268950281224192, 1153268950281224192]", + "[1153268950281224193, 1153271149304479743]", + "[1153271149304479745, 1153271699060293631]", + "[1153271699060293633, 1153272248816107519]", + "[1153272248816107520, 1153272248816107520]", + "[1153273348327735296, 1153273348327735296]", + "[1153284343444013057, 1153286542467268607]", + "[1153286542467268608, 1153286542467268608]", + "[1153286542467268609, 1153288741490524159]", + "[1153290940513779712, 1153290940513779712]", + "[1153293139537035265, 1153295338560290815]", + "[1153295338560290816, 1153295338560290816]", + "[1153295338560290817, 1153297537583546367]", + "[1153297537583546369, 1153299736606801919]", + "[1153299736606801921, 1153301935630057471]", + "[1153304134653313024, 1153304134653313024]", + "[1153306333676568577, 1153308532699824127]", + "[1153308532699824129, 1153310731723079679]", + "[1153310731723079681, 1153312930746335231]", + "[1153312930746335232, 1153312930746335232]", + "[1153312930746335233, 1153315129769590783]", + "[1153315129769590785, 1153315679525404671]", + "[1153315679525404673, 1153316229281218559]", + "[1153316229281218560, 1153316229281218560]", + "[1153316229281218561, 1153316779037032447]", + "[1153317878548660225, 1153318428304474111]", + "[1153318428304474112, 1153318428304474112]", + "[1153318428304474113, 1153318978060287999]", + "[1153320627327729664, 1153320627327729664]", + "[1153320627327729665, 1153321177083543551]", + "[1153321177083543553, 1153321726839357439]", + "[1153321726839357440, 1153321726839357440]", + "[1153321726839357441, 1153323925862612991]", + "[1153323925862612993, 1153326124885868543]", + "[1153326124885868544, 1153326124885868544]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153994627955556352, 1153994627955556352]", + "[1154007822095089664, 1154007822095089664]", + "[1154011120629972992, 1154011120629972992]", + "[1154011670385786881, 1154012220141600767]", + "[1154012220141600769, 1154014419164856319]", + "[1154014419164856321, 1154016618188111871]", + "[1154016618188111872, 1154016618188111872]", + "[1154029812327645184, 1154029812327645184]", + "[1154043006467178496, 1154043006467178496]", + "[1154043006467178497, 1154045205490434047]", + "[1154047404513689600, 1154047404513689600]", + "[1154799470467088384, 1154799470467088384]", + "[1154799470467088385, 1154801669490343935]", + "[1154803868513599488, 1154803868513599488]", + "[1154806067536855041, 1154808266560110591]", + "[1154808266560110592, 1154808266560110592]", + "[1154808266560110593, 1154810465583366143]", + "[1154821460699643904, 1154821460699643904]", + "[1154833005571735553, 1154833555327549439]", + "[1154833555327549440, 1154833555327549440]", + "[1154834654839177216, 1154834654839177216]", + "[1154839052885688320, 1154839052885688320]", + "[1154891829443821568, 1154891829443821568]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153132610839379968, 1153132610839379968]", + "[1153150203025424384, 1153150203025424384]", + "[1153150203025424385, 1153158999118446591]", + "[1153158999118446593, 1153167795211468799]", + "[1153167795211468801, 1153176591304491007]", + "[1153185387397513216, 1153185387397513216]", + "[1153198581537046528, 1153198581537046528]", + "[1153198581537046529, 1153200780560302079]", + "[1153202979583557632, 1153202979583557632]", + "[1153202979583557633, 1153211775676579839]", + "[1153211775676579841, 1153220571769602047]", + "[1153220571769602048, 1153220571769602048]", + "[1153229367862624257, 1153238163955646463]", + "[1153238163955646465, 1153246960048668671]", + "[1153246960048668673, 1153255756141690879]", + "[1153255756141690880, 1153255756141690880]", + "[1153273348327735296, 1153273348327735296]", + "[1153326124885868544, 1153326124885868544]", + "[1153326124885868545, 1153334920978890751]", + "[1153334920978890753, 1153343717071912959]", + "[1153343717071912961, 1153352513164935167]", + "[1153361309257957376, 1153361309257957376]", + "[1153370105350979585, 1153378901444001791]", + "[1153378901444001793, 1153387697537023999]", + "[1153387697537024001, 1153388247292837887]", + "[1153388797048651776, 1153388797048651776]", + "[1153389621682372608, 1153389621682372608]", + "[1153389690401849344, 1153389690401849344]", + "[1153389707581718528, 1153389707581718528]", + "[1153389711876685824, 1153389711876685824]", + "[1153389712950427648, 1153389712950427648]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713302749185, 1153389713311137791]", + "[1153392095583535104, 1153392095583535104]", + "[1153396493630046208, 1153396493630046208]", + "[1153414085816090624, 1153414085816090624]", + "[1153530634048634881, 1153532833071890431]", + "[1153532833071890432, 1153532833071890432]", + "[1153537231118401536, 1153537231118401536]", + "[1153554823304445952, 1153554823304445952]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153977035769511937, 1153985831862534143]", + "[1153985831862534145, 1153994627955556351]", + "[1153994627955556352, 1153994627955556352]", + "[1153994627955556353, 1154003424048578559]", + "[1154003424048578561, 1154005623071834111]", + "[1154005623071834113, 1154007822095089663]", + "[1154007822095089664, 1154007822095089664]", + "[1154007822095089665, 1154010021118345215]", + "[1154010021118345217, 1154010570874159103]", + "[1154010570874159105, 1154011120629972991]", + "[1154011120629972992, 1154011120629972992]", + "[1154011120629972993, 1154011670385786879]", + "[1154016618188111872, 1154016618188111872]", + "[1154016618188111873, 1154018817211367423]", + "[1154018817211367425, 1154021016234622975]", + "[1154021016234622977, 1154029812327645183]", + "[1154029812327645184, 1154029812327645184]", + "[1154029812327645185, 1154038608420667391]", + "[1154038608420667393, 1154040807443922943]", + "[1154040807443922945, 1154043006467178495]", + "[1154043006467178496, 1154043006467178496]", + "[1154045205490434049, 1154047404513689599]", + "[1154047404513689600, 1154047404513689600]", + "[1154047404513689601, 1154082588885778431]", + "[1154117773257867264, 1154117773257867264]", + "[1154328879490400256, 1154328879490400256]", + "[1154786276327555073, 1154795072420577279]", + "[1154795072420577281, 1154797271443832831]", + "[1154797271443832833, 1154799470467088383]", + "[1154799470467088384, 1154799470467088384]", + "[1154801669490343937, 1154803868513599487]", + "[1154803868513599488, 1154803868513599488]", + "[1154803868513599489, 1154806067536855039]", + "[1154808266560110592, 1154808266560110592]", + "[1154810465583366145, 1154812664606621695]", + "[1154812664606621697, 1154821460699643903]", + "[1154821460699643904, 1154821460699643904]", + "[1154821460699643905, 1154830256792666111]", + "[1154830256792666113, 1154832455815921663]", + "[1154832455815921665, 1154833005571735551]", + "[1154833555327549440, 1154833555327549440]", + "[1154833555327549441, 1154834105083363327]", + "[1154834105083363329, 1154834654839177215]", + "[1154834654839177216, 1154834654839177216]", + "[1154834654839177217, 1154836853862432767]", + "[1154836853862432769, 1154839052885688319]", + "[1154839052885688320, 1154839052885688320]", + "[1154839052885688321, 1154847848978710527]", + "[1154847848978710529, 1154856645071732735]", + "[1154891829443821568, 1154891829443821568]", + "[1154938008932188161, 1154940207955443711]", + "[1154940207955443712, 1154940207955443712]", + "[1154944606001954816, 1154944606001954816]", + "[1154962198187999232, 1154962198187999232]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1152956688978935809, 1152991873351024639]", + "[1152991873351024640, 1152991873351024640]", + "[1152991873351024641, 1153027057723113471]", + "[1153027057723113473, 1153062242095202303]", + "[1153062242095202305, 1153097426467291135]", + "[1153097426467291137, 1153132610839379967]", + "[1153132610839379968, 1153132610839379968]", + "[1153132610839379969, 1153141406932402175]", + "[1153141406932402177, 1153150203025424383]", + "[1153150203025424384, 1153150203025424384]", + "[1153176591304491009, 1153185387397513215]", + "[1153185387397513216, 1153185387397513216]", + "[1153185387397513217, 1153194183490535423]", + "[1153194183490535425, 1153196382513790975]", + "[1153196382513790977, 1153198581537046527]", + "[1153198581537046528, 1153198581537046528]", + "[1153200780560302081, 1153202979583557631]", + "[1153202979583557632, 1153202979583557632]", + "[1153352513164935169, 1153361309257957375]", + "[1153361309257957376, 1153361309257957376]", + "[1153361309257957377, 1153370105350979583]", + "[1153388247292837889, 1153388797048651775]", + "[1153388797048651776, 1153388797048651776]", + "[1153388797048651777, 1153389346804465663]", + "[1153389346804465665, 1153389484243419135]", + "[1153389484243419137, 1153389621682372607]", + "[1153389621682372608, 1153389621682372608]", + "[1153389621682372609, 1153389656042110975]", + "[1153389656042110977, 1153389690401849343]", + "[1153389690401849344, 1153389690401849344]", + "[1153389690401849345, 1153389698991783935]", + "[1153389698991783937, 1153389707581718527]", + "[1153389707581718528, 1153389707581718528]", + "[1153389707581718529, 1153389709729202175]", + "[1153389709729202177, 1153389711876685823]", + "[1153389711876685824, 1153389711876685824]", + "[1153389711876685825, 1153389712413556735]", + "[1153389712413556737, 1153389712950427647]", + "[1153389712950427648, 1153389712950427648]", + "[1153389712950427649, 1153389713084645375]", + "[1153389713084645377, 1153389713218863103]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713218863105, 1153389713252417535]", + "[1153389713252417537, 1153389713285971967]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713285971969, 1153389713294360575]", + "[1153389713294360577, 1153389713302749183]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713311137793, 1153389713319526399]", + "[1153389713319526401, 1153389713353080831]", + "[1153389713353080833, 1153389713487298559]", + "[1153389713487298561, 1153389714024169471]", + "[1153389714024169473, 1153389716171653119]", + "[1153389716171653121, 1153389724761587711]", + "[1153389724761587713, 1153389759121326079]", + "[1153389759121326081, 1153389896560279551]", + "[1153389896560279553, 1153392095583535103]", + "[1153392095583535104, 1153392095583535104]", + "[1153392095583535105, 1153394294606790655]", + "[1153394294606790657, 1153396493630046207]", + "[1153396493630046208, 1153396493630046208]", + "[1153396493630046209, 1153405289723068415]", + "[1153405289723068417, 1153414085816090623]", + "[1153414085816090624, 1153414085816090624]", + "[1153414085816090625, 1153449270188179455]", + "[1153449270188179457, 1153484454560268287]", + "[1153484454560268289, 1153519638932357119]", + "[1153519638932357121, 1153528435025379327]", + "[1153528435025379329, 1153530634048634879]", + "[1153532833071890432, 1153532833071890432]", + "[1153532833071890433, 1153535032095145983]", + "[1153535032095145985, 1153537231118401535]", + "[1153537231118401536, 1153537231118401536]", + "[1153537231118401537, 1153546027211423743]", + "[1153546027211423745, 1153554823304445951]", + "[1153554823304445952, 1153554823304445952]", + "[1153554823304445953, 1153590007676534783]", + "[1153590007676534785, 1153625192048623615]", + "[1153695560792801280, 1153695560792801280]", + "[1153748337350934528, 1153748337350934528]", + "[1153757133443956737, 1153765929536978943]", + "[1153765929536978944, 1153765929536978944]", + "[1153765929536978945, 1153774725630001151]", + "[1153774725630001153, 1153783521723023359]", + "[1153783521723023360, 1153783521723023360]", + "[1153836298281156608, 1153836298281156608]", + "[1153871482653245441, 1153906667025334271]", + "[1153906667025334273, 1153941851397423103]", + "[1153941851397423105, 1153977035769511935]", + "[1153977035769511936, 1153977035769511936]", + "[1154047404513689600, 1154047404513689600]", + "[1154082588885778433, 1154117773257867263]", + "[1154117773257867264, 1154117773257867264]", + "[1154117773257867265, 1154152957629956095]", + "[1154152957629956097, 1154188142002044927]", + "[1154188142002044929, 1154223326374133759]", + "[1154258510746222592, 1154258510746222592]", + "[1154328879490400256, 1154328879490400256]", + "[1154539985722933248, 1154539985722933248]", + "[1154539985722933249, 1154575170095022079]", + "[1154680723211288576, 1154680723211288576]", + "[1154680723211288577, 1154715907583377407]", + "[1154715907583377409, 1154751091955466239]", + "[1154751091955466241, 1154786276327555071]", + "[1154821460699643904, 1154821460699643904]", + "[1154856645071732737, 1154891829443821567]", + "[1154891829443821568, 1154891829443821568]", + "[1154891829443821569, 1154927013815910399]", + "[1154927013815910401, 1154935809908932607]", + "[1154935809908932609, 1154938008932188159]", + "[1154940207955443712, 1154940207955443712]", + "[1154940207955443713, 1154942406978699263]", + "[1154942406978699265, 1154944606001954815]", + "[1154944606001954816, 1154944606001954816]", + "[1154944606001954817, 1154953402094977023]", + "[1154953402094977025, 1154962198187999231]", + "[1154962198187999232, 1154962198187999232]", + "[1154962198187999233, 1154997382560088063]", + "[1154997382560088065, 1155032566932176895]", + "[1155076547397287937, 1155085343490310143]", + "[1155085343490310144, 1155085343490310144]", + "[1155102935676354560, 1155102935676354560]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[382805968326492160, 382805968326492160]", + "[383931868233334784, 383931868233334784]", + "[383931868233334785, 384494818186756095]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1144653177165971457, 1144688361538060287]", + "[1144688361538060288, 1144688361538060288]", + "[1144700078208843777, 1144700112568582143]", + "[1144700112568582144, 1144700112568582144]", + "[1144700181288058880, 1144700181288058880]", + "[1144700456165965824, 1144700456165965824]", + "[1144701555677593600, 1144701555677593600]", + "[1144705953724104704, 1144705953724104704]", + "[1144758730282237952, 1144758730282237952]", + "[1145040205258948608, 1145040205258948608]", + "[1148417904979476480, 1148417904979476480]", + "[1151795604700004352, 1151795604700004352]", + "[1151795604700004353, 1152358554653425663]", + "[1152358554653425665, 1152921504606846975]", + "[1152921504606846977, 1152956688978935807]", + "[1152991873351024640, 1152991873351024640]", + "[1153202979583557632, 1153202979583557632]", + "[1153625192048623617, 1153660376420712447]", + "[1153660376420712449, 1153695560792801279]", + "[1153695560792801280, 1153695560792801280]", + "[1153695560792801281, 1153730745164890111]", + "[1153730745164890113, 1153739541257912319]", + "[1153739541257912321, 1153748337350934527]", + "[1153748337350934528, 1153748337350934528]", + "[1153748337350934529, 1153757133443956735]", + "[1153765929536978944, 1153765929536978944]", + "[1153783521723023360, 1153783521723023360]", + "[1153783521723023361, 1153792317816045567]", + "[1153792317816045569, 1153801113909067775]", + "[1153801113909067777, 1153836298281156607]", + "[1153836298281156608, 1153836298281156608]", + "[1153836298281156609, 1153871482653245439]", + "[1154047404513689600, 1154047404513689600]", + "[1154223326374133761, 1154258510746222591]", + "[1154258510746222592, 1154258510746222592]", + "[1154258510746222593, 1154293695118311423]", + "[1154293695118311425, 1154328879490400255]", + "[1154328879490400256, 1154328879490400256]", + "[1154328879490400257, 1154469616978755583]", + "[1154469616978755585, 1154504801350844415]", + "[1154504801350844417, 1154539985722933247]", + "[1154539985722933248, 1154539985722933248]", + "[1154575170095022081, 1154610354467110911]", + "[1154610354467110913, 1154645538839199743]", + "[1154645538839199745, 1154680723211288575]", + "[1154680723211288576, 1154680723211288576]", + "[1154891829443821568, 1154891829443821568]", + "[1155032566932176897, 1155067751304265727]", + "[1155067751304265729, 1155076547397287935]", + "[1155085343490310144, 1155085343490310144]", + "[1155085343490310145, 1155094139583332351]", + "[1155094139583332353, 1155102935676354559]", + "[1155102935676354560, 1155102935676354560]", + "[1155102935676354561, 1155138120048443391]", + "[1155138120048443393, 1155173304420532223]", + "[1155173304420532225, 1155314041908887551]", + "[1155314041908887553, 1155454779397242879]", + "[1155454779397242880, 1155454779397242880]", + "[1156299204327374848, 1156299204327374848]", + "[1157143629257506816, 1157143629257506816]", + "[1157143629257506817, 1157284366745862143]", + "[1157284366745862145, 1157425104234217471]", + "[1157425104234217472, 1157425104234217472]", + "[1160380591489679361, 1160521328978034687]", + "[1160521328978034688, 1160521328978034688]", + "[1160521328978034689, 1160662066466390015]", + "[1160802803954745344, 1160802803954745344]", + "[1160943541443100673, 1161084278931455999]", + "[1161084278931456000, 1161084278931456000]", + "[1161084278931456001, 1161225016419811327]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1919659341166673920, 1919659341166673920]", + "[1920503766096805888, 1920503766096805888]", + "[1920644503585161217, 1920785241073516543]", + "[1920785241073516545, 1921348191026937855]", + "[1921348191026937857, 1921911140980359167]", + "[1921911140980359168, 1921911140980359168]", + "[1923037040887201792, 1923037040887201792]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[381680068419649536, 381680068419649536]", + "[381680068419649537, 382243018373070847]", + "[382805968326492160, 382805968326492160]", + "[382805968326492161, 383368918279913471]", + "[383368918279913473, 383931868233334783]", + "[383931868233334784, 383931868233334784]", + "[384494818186756097, 385057768140177407]", + "[385057768140177409, 385620718093598719]", + "[386183668047020032, 386183668047020032]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1143914305352105985, 1144477255305527295]", + "[1144477255305527297, 1144617992793882623]", + "[1144617992793882625, 1144653177165971455]", + "[1144688361538060288, 1144688361538060288]", + "[1144688361538060289, 1144697157631082495]", + "[1144697157631082497, 1144699356654338047]", + "[1144699356654338049, 1144699906410151935]", + "[1144699906410151937, 1144700043849105407]", + "[1144700043849105409, 1144700078208843775]", + "[1144700112568582144, 1144700112568582144]", + "[1144700112568582145, 1144700146928320511]", + "[1144700146928320513, 1144700181288058879]", + "[1144700181288058880, 1144700181288058880]", + "[1144700181288058881, 1144700318727012351]", + "[1144700318727012353, 1144700456165965823]", + "[1144700456165965824, 1144700456165965824]", + "[1144700456165965825, 1144701005921779711]", + "[1144701005921779713, 1144701555677593599]", + "[1144701555677593600, 1144701555677593600]", + "[1144701555677593601, 1144703754700849151]", + "[1144703754700849153, 1144705953724104703]", + "[1144705953724104704, 1144705953724104704]", + "[1144705953724104705, 1144714749817126911]", + "[1144714749817126913, 1144723545910149119]", + "[1144723545910149121, 1144758730282237951]", + "[1144758730282237952, 1144758730282237952]", + "[1144758730282237953, 1144899467770593279]", + "[1144899467770593281, 1145040205258948607]", + "[1145040205258948608, 1145040205258948608]", + "[1145040205258948609, 1145603155212369919]", + "[1145603155212369921, 1146166105165791231]", + "[1147292005072633856, 1147292005072633856]", + "[1148136430002765824, 1148136430002765824]", + "[1148277167491121153, 1148417904979476479]", + "[1148417904979476480, 1148417904979476480]", + "[1148417904979476481, 1148980854932897791]", + "[1149543804886319104, 1149543804886319104]", + "[1150106754839740417, 1150669704793161727]", + "[1150669704793161729, 1151232654746583039]", + "[1151232654746583041, 1151795604700004351]", + "[1151795604700004352, 1151795604700004352]", + "[1155454779397242880, 1155454779397242880]", + "[1155454779397242881, 1155595516885598207]", + "[1155595516885598209, 1155736254373953535]", + "[1155736254373953537, 1156299204327374847]", + "[1156299204327374848, 1156299204327374848]", + "[1156299204327374849, 1156862154280796159]", + "[1156862154280796161, 1157002891769151487]", + "[1157002891769151489, 1157143629257506815]", + "[1157143629257506816, 1157143629257506816]", + "[1157425104234217472, 1157425104234217472]", + "[1157425104234217473, 1159676904047902719]", + "[1159676904047902721, 1160239854001324031]", + "[1160239854001324033, 1160380591489679359]", + "[1160521328978034688, 1160521328978034688]", + "[1160662066466390017, 1160802803954745343]", + "[1160802803954745344, 1160802803954745344]", + "[1160802803954745345, 1160943541443100671]", + "[1161084278931456000, 1161084278931456000]", + "[1161225016419811329, 1161365753908166655]", + "[1161365753908166657, 1161928703861587967]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1918533441259831297, 1919096391213252607]", + "[1919096391213252609, 1919659341166673919]", + "[1919659341166673920, 1919659341166673920]", + "[1919659341166673921, 1920222291120095231]", + "[1920222291120095233, 1920363028608450559]", + "[1920363028608450561, 1920503766096805887]", + "[1920503766096805888, 1920503766096805888]", + "[1920503766096805889, 1920644503585161215]", + "[1921911140980359168, 1921911140980359168]", + "[1921911140980359169, 1922474090933780479]", + "[1922474090933780481, 1923037040887201791]", + "[1923037040887201792, 1923037040887201792]", + "[1923037040887201793, 1923599990840623103]", + "[1923599990840623105, 1924162940794044415]", + "[1924162940794044416, 1924162940794044416]", + "[1925992528142663681, 1926133265631019007]", + "[1926133265631019008, 1926133265631019008]", + "[1926414740607729664, 1926414740607729664]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[373798769071751168, 373798769071751168]", + "[373798769071751169, 376050568885436415]", + "[376050568885436417, 376613518838857727]", + "[377176468792279040, 377176468792279040]", + "[378020893722411008, 378020893722411008]", + "[378091262466588672, 378091262466588672]", + "[378091262466588673, 378126446838677503]", + "[378302368699121664, 378302368699121664]", + "[378302368699121665, 380554168512806911]", + "[380554168512806913, 381117118466228223]", + "[381117118466228225, 381680068419649535]", + "[381680068419649536, 381680068419649536]", + "[382243018373070849, 382805968326492159]", + "[382805968326492160, 382805968326492160]", + "[385620718093598721, 386183668047020031]", + "[386183668047020032, 386183668047020032]", + "[386183668047020033, 386746618000441343]", + "[386746618000441345, 387309567953862655]", + "[387309567953862657, 389561367767547903]", + "[389561367767547905, 391813167581233151]", + "[391813167581233152, 391813167581233152]", + "[1080863910568919040, 1080863910568919040]", + "[1119144507401568257, 1121396307215253503]", + "[1121396307215253504, 1121396307215253504]", + "[1121396307215253505, 1123648107028938751]", + "[1130403506469994496, 1130403506469994496]", + "[1133781206190522368, 1133781206190522368]", + "[1134344156143943681, 1134907106097364991]", + "[1134907106097364992, 1134907106097364992]", + "[1134907106097364993, 1143914305352105983]", + "[1146166105165791233, 1146729055119212543]", + "[1146729055119212545, 1147292005072633855]", + "[1147292005072633856, 1147292005072633856]", + "[1147292005072633857, 1147854955026055167]", + "[1147854955026055169, 1147995692514410495]", + "[1147995692514410497, 1148136430002765823]", + "[1148136430002765824, 1148136430002765824]", + "[1148136430002765825, 1148277167491121151]", + "[1148417904979476480, 1148417904979476480]", + "[1148980854932897793, 1149543804886319103]", + "[1149543804886319104, 1149543804886319104]", + "[1149543804886319105, 1150106754839740415]", + "[1161928703861587969, 1170935903116328959]", + "[1170935903116328960, 1170935903116328960]", + "[1170935903116328961, 1173187702930014207]", + "[1175439502743699456, 1175439502743699456]", + "[1179943102371069953, 1188950301625810943]", + "[1224979098644774912, 1224979098644774912]", + "[1909526242005090305, 1918533441259831295]", + "[1923037040887201792, 1923037040887201792]", + "[1924162940794044416, 1924162940794044416]", + "[1924162940794044417, 1924725890747465727]", + "[1924725890747465729, 1925288840700887039]", + "[1925288840700887041, 1925851790654308351]", + "[1925851790654308353, 1925992528142663679]", + "[1926133265631019008, 1926133265631019008]", + "[1926133265631019009, 1926274003119374335]", + "[1926274003119374337, 1926414740607729663]", + "[1926414740607729664, 1926414740607729664]", + "[1926414740607729665, 1926977690561150975]", + "[1926977690561150977, 1927540640514572287]", + "[1927540640514572288, 1927540640514572288]", + "[1927540640514572289, 1929792440328257535]", + "[1929792440328257537, 1932044240141942783]", + "[1932044240141942784, 1932044240141942784]", + "[1939362589536419841, 1939925539489841151]", + "[1939925539489841152, 1939925539489841152]", + "[1941051439396683776, 1941051439396683776]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[342273571680157696, 342273571680157696]", + "[342273571680157697, 351280770934898687]", + "[351280770934898689, 353532570748583935]", + "[355784370562269184, 355784370562269184]", + "[358036170375954433, 360287970189639679]", + "[360287970189639680, 360287970189639680]", + "[360287970189639681, 369295169444380671]", + "[369295169444380673, 371546969258065919]", + "[371546969258065921, 373798769071751167]", + "[373798769071751168, 373798769071751168]", + "[376613518838857729, 377176468792279039]", + "[377176468792279040, 377176468792279040]", + "[377176468792279041, 377739418745700351]", + "[377739418745700353, 377880156234055679]", + "[377880156234055681, 378020893722411007]", + "[378020893722411008, 378020893722411008]", + "[378020893722411009, 378056078094499839]", + "[378056078094499841, 378091262466588671]", + "[378091262466588672, 378091262466588672]", + "[378126446838677505, 378161631210766335]", + "[378161631210766337, 378302368699121663]", + "[378302368699121664, 378302368699121664]", + "[391813167581233152, 391813167581233152]", + "[391813167581233153, 394064967394918399]", + "[394064967394918401, 396316767208603647]", + "[396316767208603649, 405323966463344639]", + "[405323966463344641, 414331165718085631]", + "[414331165718085632, 414331165718085632]", + "[1008806316530991105, 1044835113549955071]", + "[1062849512059437056, 1062849512059437056]", + "[1076360310941548544, 1076360310941548544]", + "[1079738010662076416, 1079738010662076416]", + "[1080300960615497729, 1080863910568919039]", + "[1080863910568919040, 1080863910568919040]", + "[1080863910568919041, 1089871109823660031]", + "[1098878309078401024, 1098878309078401024]", + "[1107885508333142017, 1116892707587883007]", + "[1116892707587883009, 1119144507401568255]", + "[1121396307215253504, 1121396307215253504]", + "[1123648107028938753, 1125899906842623999]", + "[1125899906842624001, 1128151706656309247]", + "[1128151706656309249, 1130403506469994495]", + "[1130403506469994496, 1130403506469994496]", + "[1130403506469994497, 1132655306283679743]", + "[1132655306283679745, 1133218256237101055]", + "[1133218256237101057, 1133781206190522367]", + "[1133781206190522368, 1133781206190522368]", + "[1133781206190522369, 1134344156143943679]", + "[1134907106097364992, 1134907106097364992]", + "[1170935903116328960, 1170935903116328960]", + "[1173187702930014209, 1175439502743699455]", + "[1175439502743699456, 1175439502743699456]", + "[1175439502743699457, 1177691302557384703]", + "[1177691302557384705, 1179943102371069951]", + "[1188950301625810945, 1224979098644774911]", + "[1224979098644774912, 1224979098644774912]", + "[1224979098644774913, 1233986297899515903]", + "[1242993497154256896, 1242993497154256896]", + "[1261007895663738881, 1297036692682702847]", + "[1873497444986126337, 1909526242005090303]", + "[1927540640514572288, 1927540640514572288]", + "[1932044240141942784, 1932044240141942784]", + "[1932044240141942785, 1934296039955628031]", + "[1934296039955628033, 1936547839769313279]", + "[1936547839769313281, 1938799639582998527]", + "[1938799639582998529, 1939362589536419839]", + "[1939925539489841152, 1939925539489841152]", + "[1939925539489841153, 1940488489443262463]", + "[1940488489443262465, 1941051439396683775]", + "[1941051439396683776, 1941051439396683776]", + "[1941051439396683777, 1943303239210369023]", + "[1943303239210369025, 1945555039024054271]", + "[1945555039024054272, 1945555039024054272]", + "[1945555039024054273, 1954562238278795263]", + "[1954562238278795265, 1963569437533536255]", + "[1963569437533536256, 1963569437533536256]", + "[1993405785064865793, 1993968735018287103]", + "[1993968735018287104, 1993968735018287104]", + "[1995094634925129728, 1995094634925129728]", + "[1999598234552500224, 1999598234552500224]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[144115188075855873, 288230376151711743]", + "[288230376151711745, 324259173170675711]", + "[324259173170675713, 333266372425416703]", + "[333266372425416705, 342273571680157695]", + "[342273571680157696, 342273571680157696]", + "[353532570748583937, 355784370562269183]", + "[355784370562269184, 355784370562269184]", + "[355784370562269185, 358036170375954431]", + "[360287970189639680, 360287970189639680]", + "[414331165718085632, 414331165718085632]", + "[414331165718085633, 423338364972826623]", + "[423338364972826625, 432345564227567615]", + "[432345564227567617, 468374361246531583]", + "[468374361246531585, 504403158265495551]", + "[504403158265495552, 504403158265495552]", + "[612489549322387457, 648518346341351423]", + "[648518346341351424, 648518346341351424]", + "[648518346341351425, 684547143360315391]", + "[792633534417207296, 792633534417207296]", + "[846676729945653248, 846676729945653248]", + "[860187528827764736, 860187528827764736]", + "[863565228548292608, 863565228548292608]", + "[864128178501713921, 864691128455135231]", + "[864691128455135233, 900719925474099199]", + "[936748722493063168, 936748722493063168]", + "[972777519512027137, 1008806316530991103]", + "[1044835113549955073, 1053842312804696063]", + "[1053842312804696065, 1062849512059437055]", + "[1062849512059437056, 1062849512059437056]", + "[1062849512059437057, 1071856711314178047]", + "[1071856711314178049, 1074108511127863295]", + "[1074108511127863297, 1076360310941548543]", + "[1076360310941548544, 1076360310941548544]", + "[1076360310941548545, 1078612110755233791]", + "[1078612110755233793, 1079175060708655103]", + "[1079175060708655105, 1079738010662076415]", + "[1079738010662076416, 1079738010662076416]", + "[1079738010662076417, 1080300960615497727]", + "[1080863910568919040, 1080863910568919040]", + "[1089871109823660033, 1098878309078401023]", + "[1098878309078401024, 1098878309078401024]", + "[1098878309078401025, 1107885508333142015]", + "[1224979098644774912, 1224979098644774912]", + "[1233986297899515905, 1242993497154256895]", + "[1242993497154256896, 1242993497154256896]", + "[1242993497154256897, 1252000696408997887]", + "[1252000696408997889, 1261007895663738879]", + "[1297036692682702849, 1333065489701666815]", + "[1369094286720630784, 1369094286720630784]", + "[1405123083739594753, 1441151880758558719]", + "[1441151880758558721, 1450159080013299711]", + "[1459166279268040704, 1459166279268040704]", + "[1513209474796486656, 1513209474796486656]", + "[1585267068834414593, 1729382256910270463]", + "[1729382256910270465, 1873497444986126335]", + "[1945555039024054272, 1945555039024054272]", + "[1963569437533536256, 1963569437533536256]", + "[1963569437533536257, 1972576636788277247]", + "[1972576636788277249, 1981583836043018239]", + "[1981583836043018241, 1990591035297759231]", + "[1990591035297759233, 1992842835111444479]", + "[1992842835111444481, 1993405785064865791]", + "[1993968735018287104, 1993968735018287104]", + "[1993968735018287105, 1994531684971708415]", + "[1994531684971708417, 1995094634925129727]", + "[1995094634925129728, 1995094634925129728]", + "[1995094634925129729, 1997346434738814975]", + "[1997346434738814977, 1999598234552500223]", + "[1999598234552500224, 1999598234552500224]", + "[1999598234552500225, 2008605433807241215]", + "[2008605433807241217, 2017612633061982207]", + "[2017612633061982209, 2053641430080946175]", + "[2053641430080946177, 2089670227099910143]", + "[2089670227099910144, 2089670227099910144]", + "[2209578567178649601, 2210141517132070911]", + "[2210141517132070912, 2210141517132070912]", + "[2211267417038913536, 2211267417038913536]", + "[2215771016666284032, 2215771016666284032]", + "[2233785415175766016, 2233785415175766016]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-8502796096475496447, -8358680908399640577]", + "[-8358680908399640575, -8214565720323784705]", + "[-7926335344172072959, -7782220156096217089]", + "[-7782220156096217087, -7638104968020361217]", + "[-5476377146882523135, -5332261958806667265]", + "[-5332261958806667263, -5188146770730811393]", + "[-5188146770730811391, -5044031582654955521]", + "[-4755801206503243775, -4611686018427387905]", + "[1, 144115188075855871]", + "[504403158265495552, 504403158265495552]", + "[504403158265495553, 540431955284459519]", + "[540431955284459521, 576460752303423487]", + "[576460752303423489, 612489549322387455]", + "[648518346341351424, 648518346341351424]", + "[684547143360315393, 720575940379279359]", + "[720575940379279361, 756604737398243327]", + "[756604737398243329, 792633534417207295]", + "[792633534417207296, 792633534417207296]", + "[792633534417207297, 828662331436171263]", + "[828662331436171265, 837669530690912255]", + "[837669530690912257, 846676729945653247]", + "[846676729945653248, 846676729945653248]", + "[846676729945653249, 855683929200394239]", + "[855683929200394241, 857935729014079487]", + "[857935729014079489, 860187528827764735]", + "[860187528827764736, 860187528827764736]", + "[860187528827764737, 862439328641449983]", + "[862439328641449985, 863002278594871295]", + "[863002278594871297, 863565228548292607]", + "[863565228548292608, 863565228548292608]", + "[863565228548292609, 864128178501713919]", + "[900719925474099201, 936748722493063167]", + "[936748722493063168, 936748722493063168]", + "[936748722493063169, 972777519512027135]", + "[1333065489701666817, 1369094286720630783]", + "[1369094286720630784, 1369094286720630784]", + "[1369094286720630785, 1405123083739594751]", + "[1450159080013299713, 1459166279268040703]", + "[1459166279268040704, 1459166279268040704]", + "[1459166279268040705, 1468173478522781695]", + "[1468173478522781697, 1477180677777522687]", + "[1477180677777522689, 1513209474796486655]", + "[1513209474796486656, 1513209474796486656]", + "[1513209474796486657, 1549238271815450623]", + "[1549238271815450625, 1585267068834414591]", + "[2089670227099910144, 2089670227099910144]", + "[2089670227099910145, 2125699024118874111]", + "[2125699024118874113, 2161727821137838079]", + "[2161727821137838081, 2197756618156802047]", + "[2197756618156802049, 2206763817411543039]", + "[2206763817411543041, 2209015617225228287]", + "[2209015617225228289, 2209578567178649599]", + "[2210141517132070912, 2210141517132070912]", + "[2210141517132070913, 2210704467085492223]", + "[2210704467085492225, 2211267417038913535]", + "[2211267417038913536, 2211267417038913536]", + "[2211267417038913537, 2213519216852598783]", + "[2213519216852598785, 2215771016666284031]", + "[2215771016666284032, 2215771016666284032]", + "[2215771016666284033, 2224778215921025023]", + "[2224778215921025025, 2233785415175766015]", + "[2233785415175766016, 2233785415175766016]", + "[2233785415175766017, 2269814212194729983]", + "[2269814212194729985, 2305843009213693951]", + "[2305843009213693953, 2449958197289549823]", + "[2449958197289549825, 2594073385365405695]", + "[4323455642275676161, 4467570830351532031]", + "[4467570830351532033, 4611686018427387903]", + "[4611686018427387905, 4755801206503243775]", + "[5044031582654955521, 5188146770730811391]", + "[5188146770730811393, 5332261958806667263]", + "[5332261958806667265, 5476377146882523135]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-9223372036854775807, -8646911284551352321]", + "[-8646911284551352319, -8502796096475496449]", + "[-8214565720323784703, -8070450532247928833]", + "[-8070450532247928831, -7926335344172072961]", + "[-7638104968020361215, -7493989779944505345]", + "[-7493989779944505343, -6917529027641081857]", + "[-6917529027641081855, -6341068275337658369]", + "[-6341068275337658367, -5764607523034234881]", + "[-5764607523034234879, -5620492334958379009]", + "[-5620492334958379007, -5476377146882523137]", + "[-5044031582654955519, -4899916394579099649]", + "[-4899916394579099647, -4755801206503243777]", + "[2594073385365405697, 2738188573441261567]", + "[2738188573441261569, 2882303761517117439]", + "[2882303761517117441, 3458764513820540927]", + "[3458764513820540929, 4035225266123964415]", + "[4035225266123964417, 4179340454199820287]", + "[4179340454199820289, 4323455642275676159]", + "[4755801206503243777, 4899916394579099647]", + "[4899916394579099649, 5044031582654955519]", + "[5476377146882523137, 5620492334958379007]", + "[5620492334958379009, 5764607523034234879]", + "[5764607523034234881, 6341068275337658367]", + "[6341068275337658369, 6917529027641081855]", + "[6917529027641081857, 6926536226895822847]", + "[6935543426150563840, 6935543426150563840]", + "[6989586621679009792, 6989586621679009792]", + "[7686096451549528065, 7686237189037883391]", + "[7686237189037883392, 7686237189037883392]", + "[7686518664014594048, 7686518664014594048]", + "[7687644563921436672, 7687644563921436672]", + "[7692148163548807168, 7692148163548807168]", + "[7710162562058289152, 7710162562058289152]", + "[9151314442816847872, 9151314442816847872]", + "[9205357638345293824, 9205357638345293824]", + "[9218868437227405312, 9218868437227405312]", + "[9222246136947933184, 9222246136947933184]", + "[9223090561878065152, 9223090561878065152]", + "[9223231299366420481, 9223372036854775807]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[6926536226895822849, 6935543426150563839]", + "[6935543426150563840, 6935543426150563840]", + "[6935543426150563841, 6944550625405304831]", + "[6944550625405304833, 6953557824660045823]", + "[6953557824660045825, 6989586621679009791]", + "[6989586621679009792, 6989586621679009792]", + "[6989586621679009793, 7025615418697973759]", + "[7025615418697973761, 7061644215716937727]", + "[7061644215716937729, 7205759403792793599]", + "[7205759403792793601, 7349874591868649471]", + "[7349874591868649473, 7493989779944505343]", + "[7493989779944505345, 7638104968020361215]", + "[7638104968020361217, 7674133765039325183]", + "[7674133765039325185, 7683140964294066175]", + "[7683140964294066177, 7685392764107751423]", + "[7685392764107751425, 7685955714061172735]", + "[7685955714061172737, 7686096451549528063]", + "[7686237189037883392, 7686237189037883392]", + "[7686237189037883393, 7686377926526238719]", + "[7686377926526238721, 7686518664014594047]", + "[7686518664014594048, 7686518664014594048]", + "[7686518664014594049, 7687081613968015359]", + "[7687081613968015361, 7687644563921436671]", + "[7687644563921436672, 7687644563921436672]", + "[7687644563921436673, 7689896363735121919]", + "[7689896363735121921, 7692148163548807167]", + "[7692148163548807168, 7692148163548807168]", + "[7692148163548807169, 7701155362803548159]", + "[7701155362803548161, 7710162562058289151]", + "[7710162562058289152, 7710162562058289152]", + "[7710162562058289153, 7746191359077253119]", + "[7746191359077253121, 7782220156096217087]", + "[7782220156096217089, 7926335344172072959]", + "[7926335344172072961, 8070450532247928831]", + "[8070450532247928833, 8646911284551352319]", + "[8646911284551352321, 8791026472627208191]", + "[8791026472627208193, 8935141660703064063]", + "[8935141660703064065, 9079256848778919935]", + "[9079256848778919937, 9115285645797883903]", + "[9115285645797883905, 9151314442816847871]", + "[9151314442816847872, 9151314442816847872]", + "[9151314442816847873, 9187343239835811839]", + "[9187343239835811841, 9196350439090552831]", + "[9196350439090552833, 9205357638345293823]", + "[9205357638345293824, 9205357638345293824]", + "[9205357638345293825, 9214364837600034815]", + "[9214364837600034817, 9216616637413720063]", + "[9216616637413720065, 9218868437227405311]", + "[9218868437227405312, 9218868437227405312]", + "[9218868437227405313, 9221120237041090559]", + "[9221120237041090561, 9221683186994511871]", + "[9221683186994511873, 9222246136947933183]", + "[9222246136947933184, 9222246136947933184]", + "[9222246136947933185, 9222809086901354495]", + "[9222809086901354497, 9222949824389709823]", + "[9222949824389709825, 9223090561878065151]", + "[9223090561878065152, 9223090561878065152]", + "[9223090561878065153, 9223231299366420479]" + ] + }, + "keysExamined" : 0, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + ] + } + } + }, + "ts" : ISODate("2017-10-15T01:54:44.873Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/geonear_3.5.11 b/src/go/tests/doc/out/geonear_3.5.11 new file mode 100644 index 00000000..57fece10 --- /dev/null +++ b/src/go/tests/doc/out/geonear_3.5.11 @@ -0,0 +1,3566 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "geoNear" : "coll", + "near" : { + "type" : "Point", + "coordinates" : [ + 1, + 1 + ] + }, + "spherical" : true, + "$db" : "test" + }, + "keysExamined" : 82, + "docsExamined" : 10, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(4) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2) + } + } + }, + "responseLength" : 1383, + "protocol" : "op_msg", + "millis" : 11, + "planSummary" : "GEO_NEAR_2DSPHERE { loc: \"2dsphere\" }", + "execStats" : { + "stage" : "LIMIT", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "limitAmount" : 100, + "inputStage" : { + "stage" : "PROJECTION", + "nReturned" : 10, + "executionTimeMillisEstimate" : 10, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "transformBy" : { + "$pt" : { + "$meta" : "geoNearPoint" + }, + "$dis" : { + "$meta" : "geoNearDistance" + } + }, + "inputStage" : { + "stage" : "GEO_NEAR_2DSPHERE", + "nReturned" : 10, + "executionTimeMillisEstimate" : 0, + "works" : 139, + "advanced" : 10, + "needTime" : 128, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "indexVersion" : 2, + "searchIntervals" : [ + { + "minDistance" : 0, + "maxDistance" : 3.3284465774864755, + "maxInclusive" : false, + "nBuffered" : 1, + "nReturned" : 1 + }, + { + "minDistance" : 3.3284465774864755, + "maxDistance" : 9.985339732459426, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 9.985339732459426, + "maxDistance" : 23.299126042405327, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 23.299126042405327, + "maxDistance" : 49.92669866229713, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 49.92669866229713, + "maxDistance" : 103.18184390208074, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 103.18184390208074, + "maxDistance" : 209.69213438164797, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 209.69213438164797, + "maxDistance" : 422.71271534078244, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 422.71271534078244, + "maxDistance" : 848.7538772590513, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 848.7538772590513, + "maxDistance" : 1700.8362010955889, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 1700.8362010955889, + "maxDistance" : 3405.0008487686646, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3405.0008487686646, + "maxDistance" : 6813.330144114816, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6813.330144114816, + "maxDistance" : 13629.988734807117, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13629.988734807117, + "maxDistance" : 27263.30591619172, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 27263.30591619172, + "maxDistance" : 54529.94027896093, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 54529.94027896093, + "maxDistance" : 109063.20900449934, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 109063.20900449934, + "maxDistance" : 218129.74645557615, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 2 + }, + { + "minDistance" : 218129.74645557615, + "maxDistance" : 436262.82135772984, + "maxInclusive" : false, + "nBuffered" : 3, + "nReturned" : 1 + }, + { + "minDistance" : 436262.82135772984, + "maxDistance" : 872528.9711620372, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 872528.9711620372, + "maxDistance" : 1745061.2707706518, + "maxInclusive" : false, + "nBuffered" : 2, + "nReturned" : 3 + }, + { + "minDistance" : 1745061.2707706518, + "maxDistance" : 3490125.869987881, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 3490125.869987881, + "maxDistance" : 6980255.06842234, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 6980255.06842234, + "maxDistance" : 13960513.465291258, + "maxInclusive" : false, + "nBuffered" : 0, + "nReturned" : 0 + }, + { + "minDistance" : 13960513.465291258, + "maxDistance" : 20037392.10386106, + "maxInclusive" : true, + "nBuffered" : 0, + "nReturned" : 0 + } + ], + "inputStages" : [ + { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837631979521, 1153277837632012287]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837633421313, 1153277837633454079]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633454081, 1153277837633486847]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633617921, 1153277837633650687]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837633650689, 1153277837633781759]", + "[1153277837633781761, 1153277837633912831]", + "[1153277837633912833, 1153277837634043903]", + "[1153277837634043905, 1153277837634076671]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634142209, 1153277837634174975]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634371585, 1153277837634404351]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837650198529, 1153277837650231295]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650231297, 1153277837650264063]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837650427905, 1153277837650558975]", + "[1153277837650558977, 1153277837650690047]", + "[1153277837650690049, 1153277837651214335]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652557825, 1153277837652590591]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652590593, 1153277837652623359]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837626048513, 1153277837626572799]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626703873, 1153277837626834943]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629849601, 1153277837629980671]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837631291393, 1153277837631815679]", + "[1153277837631815681, 1153277837631946751]", + "[1153277837631946753, 1153277837631979519]", + "[1153277837632012288, 1153277837632012288]", + "[1153277837632012289, 1153277837632045055]", + "[1153277837632045057, 1153277837632077823]", + "[1153277837632077824, 1153277837632077824]", + "[1153277837632077825, 1153277837632208895]", + "[1153277837632208897, 1153277837632339967]", + "[1153277837632339969, 1153277837632864255]", + "[1153277837632864256, 1153277837632864256]", + "[1153277837632864257, 1153277837633388543]", + "[1153277837633388545, 1153277837633421311]", + "[1153277837633454080, 1153277837633454080]", + "[1153277837633486849, 1153277837633519615]", + "[1153277837633519617, 1153277837633552383]", + "[1153277837633552385, 1153277837633585151]", + "[1153277837633585152, 1153277837633585152]", + "[1153277837633585153, 1153277837633617919]", + "[1153277837633650688, 1153277837633650688]", + "[1153277837634076673, 1153277837634109439]", + "[1153277837634109440, 1153277837634109440]", + "[1153277837634109441, 1153277837634142207]", + "[1153277837634174976, 1153277837634174976]", + "[1153277837634174977, 1153277837634306047]", + "[1153277837634306049, 1153277837634338815]", + "[1153277837634338817, 1153277837634371583]", + "[1153277837634371584, 1153277837634371584]", + "[1153277837634404353, 1153277837634437119]", + "[1153277837634437121, 1153277837634961407]", + "[1153277837634961408, 1153277837634961408]", + "[1153277837634961409, 1153277837635485695]", + "[1153277837635485697, 1153277837636009983]", + "[1153277837636009985, 1153277837636141055]", + "[1153277837636141057, 1153277837636272127]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641252865, 1153277837641777151]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642825729, 1153277837643350015]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643513857, 1153277837643546623]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646626817, 1153277837646757887]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837648068609, 1153277837648592895]", + "[1153277837648592897, 1153277837649117183]", + "[1153277837649117185, 1153277837649641471]", + "[1153277837649641472, 1153277837649641472]", + "[1153277837649641473, 1153277837650165759]", + "[1153277837650165761, 1153277837650198527]", + "[1153277837650231296, 1153277837650231296]", + "[1153277837650264065, 1153277837650296831]", + "[1153277837650296833, 1153277837650427903]", + "[1153277837650427904, 1153277837650427904]", + "[1153277837651214337, 1153277837651738623]", + "[1153277837651738624, 1153277837651738624]", + "[1153277837651738625, 1153277837652262911]", + "[1153277837652262913, 1153277837652393983]", + "[1153277837652393985, 1153277837652525055]", + "[1153277837652525056, 1153277837652525056]", + "[1153277837652525057, 1153277837652557823]", + "[1153277837652590592, 1153277837652590592]", + "[1153277837652623361, 1153277837652656127]", + "[1153277837652656129, 1153277837652787199]", + "[1153277837652787201, 1153277837653311487]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837654360065, 1153277837654884351]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657702401, 1153277837657735167]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657767937, 1153277837657899007]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658030081, 1153277837658554367]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837910736896, 1153277837910736896]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836925075457, 1153277836927172607]", + "[1153277836927172609, 1153277836929269759]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837518569473, 1153277837520666623]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837520666625, 1153277837522763775]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837610844161, 1153277837612941311]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837612941313, 1153277837615038463]", + "[1153277837617135617, 1153277837625524223]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837625524225, 1153277837626048511]", + "[1153277837626572800, 1153277837626572800]", + "[1153277837626572801, 1153277837626703871]", + "[1153277837626834944, 1153277837626834944]", + "[1153277837626834945, 1153277837626966015]", + "[1153277837626966017, 1153277837627097087]", + "[1153277837627097089, 1153277837627621375]", + "[1153277837627621377, 1153277837629718527]", + "[1153277837629718528, 1153277837629718528]", + "[1153277837629718529, 1153277837629849599]", + "[1153277837629980672, 1153277837629980672]", + "[1153277837629980673, 1153277837630111743]", + "[1153277837630111745, 1153277837630242815]", + "[1153277837630242817, 1153277837630767103]", + "[1153277837630767104, 1153277837630767104]", + "[1153277837630767105, 1153277837631291391]", + "[1153277837636272128, 1153277837636272128]", + "[1153277837636272129, 1153277837636403199]", + "[1153277837636403201, 1153277837636534271]", + "[1153277837636534273, 1153277837637058559]", + "[1153277837637058560, 1153277837637058560]", + "[1153277837637058561, 1153277837637582847]", + "[1153277837637582849, 1153277837638107135]", + "[1153277837638107136, 1153277837638107136]", + "[1153277837638107137, 1153277837640204287]", + "[1153277837640204289, 1153277837640728575]", + "[1153277837640728577, 1153277837641252863]", + "[1153277837641252864, 1153277837641252864]", + "[1153277837641777153, 1153277837642301439]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837642301441, 1153277837642825727]", + "[1153277837643350016, 1153277837643350016]", + "[1153277837643350017, 1153277837643481087]", + "[1153277837643481089, 1153277837643513855]", + "[1153277837643546624, 1153277837643546624]", + "[1153277837643546625, 1153277837643579391]", + "[1153277837643579393, 1153277837643612159]", + "[1153277837643612160, 1153277837643612160]", + "[1153277837643612161, 1153277837643743231]", + "[1153277837643743233, 1153277837643874303]", + "[1153277837643874305, 1153277837644398591]", + "[1153277837644398593, 1153277837646495743]", + "[1153277837646495744, 1153277837646495744]", + "[1153277837646495745, 1153277837646626815]", + "[1153277837646757888, 1153277837646757888]", + "[1153277837646757889, 1153277837646888959]", + "[1153277837646888961, 1153277837647020031]", + "[1153277837647020033, 1153277837647544319]", + "[1153277837647544320, 1153277837647544320]", + "[1153277837647544321, 1153277837648068607]", + "[1153277837653311489, 1153277837653835775]", + "[1153277837653835776, 1153277837653835776]", + "[1153277837653835777, 1153277837654360063]", + "[1153277837654884352, 1153277837654884352]", + "[1153277837654884353, 1153277837656981503]", + "[1153277837656981505, 1153277837657505791]", + "[1153277837657505793, 1153277837657636863]", + "[1153277837657636865, 1153277837657669631]", + "[1153277837657669633, 1153277837657702399]", + "[1153277837657702400, 1153277837657702400]", + "[1153277837657735169, 1153277837657767935]", + "[1153277837657767936, 1153277837657767936]", + "[1153277837657899009, 1153277837658030079]", + "[1153277837658030080, 1153277837658030080]", + "[1153277837658554369, 1153277837659078655]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837659078657, 1153277837661175807]", + "[1153277837661175809, 1153277837663272959]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837669564417, 1153277837671661567]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837671661569, 1153277837673758719]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756858369, 1153277837756989439]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837761839105, 1153277837763936255]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837763936257, 1153277837766033407]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838355333121, 1153277838357430271]", + "[1153277838357430273, 1153277838359527423]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836904103937, 1153277836912492543]", + "[1153277836912492545, 1153277836920881151]", + "[1153277836920881152, 1153277836920881152]", + "[1153277836920881153, 1153277836922978303]", + "[1153277836922978305, 1153277836925075455]", + "[1153277836925075456, 1153277836925075456]", + "[1153277836929269761, 1153277836937658367]", + "[1153277836937658369, 1153277836946046975]", + "[1153277836946046977, 1153277836946571263]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836954435584, 1153277836954435584]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837500383233, 1153277837500415999]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837505986561, 1153277837508083711]", + "[1153277837508083713, 1153277837516472319]", + "[1153277837516472321, 1153277837518569471]", + "[1153277837520666624, 1153277837520666624]", + "[1153277837522763777, 1153277837524860927]", + "[1153277837524860928, 1153277837524860928]", + "[1153277837524860929, 1153277837533249535]", + "[1153277837533249537, 1153277837541638143]", + "[1153277837543735297, 1153277837545832447]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837566803969, 1153277837575192575]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837575192577, 1153277837583581183]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837600358401, 1153277837608747007]", + "[1153277837608747009, 1153277837610844159]", + "[1153277837612941312, 1153277837612941312]", + "[1153277837615038465, 1153277837617135615]", + "[1153277837625524224, 1153277837625524224]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837659078656, 1153277837659078656]", + "[1153277837663272960, 1153277837663272960]", + "[1153277837663272961, 1153277837665370111]", + "[1153277837665370113, 1153277837667467263]", + "[1153277837667467265, 1153277837669564415]", + "[1153277837671661568, 1153277837671661568]", + "[1153277837673758721, 1153277837675855871]", + "[1153277837675855873, 1153277837709410303]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837709410305, 1153277837717798911]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837738770433, 1153277837740867583]", + "[1153277837742964737, 1153277837751353343]", + "[1153277837751353345, 1153277837753450495]", + "[1153277837753450497, 1153277837755547647]", + "[1153277837755547648, 1153277837755547648]", + "[1153277837755547649, 1153277837756071935]", + "[1153277837756071937, 1153277837756596223]", + "[1153277837756596224, 1153277837756596224]", + "[1153277837756596225, 1153277837756727295]", + "[1153277837756727297, 1153277837756858367]", + "[1153277837756858368, 1153277837756858368]", + "[1153277837756989441, 1153277837757120511]", + "[1153277837757120513, 1153277837757644799]", + "[1153277837757644801, 1153277837759741951]", + "[1153277837759741952, 1153277837759741952]", + "[1153277837759741953, 1153277837761839103]", + "[1153277837763936256, 1153277837763936256]", + "[1153277837766033409, 1153277837768130559]", + "[1153277837768130561, 1153277837776519167]", + "[1153277837776519169, 1153277837784907775]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837910736896, 1153277837910736896]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838338031617, 1153277838338555903]", + "[1153277838338555905, 1153277838346944511]", + "[1153277838346944513, 1153277838355333119]", + "[1153277838359527424, 1153277838359527424]", + "[1153277838359527425, 1153277838361624575]", + "[1153277838361624577, 1153277838363721727]", + "[1153277838363721728, 1153277838363721728]", + "[1153277838363721729, 1153277838372110335]", + "[1153277838372110337, 1153277838380498943]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838447607808, 1153277838447607808]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836769886209, 1153277836803440639]", + "[1153277836803440641, 1153277836836995071]", + "[1153277836836995072, 1153277836836995072]", + "[1153277836836995073, 1153277836870549503]", + "[1153277836870549505, 1153277836904103935]", + "[1153277836904103936, 1153277836904103936]", + "[1153277836946571265, 1153277836947095551]", + "[1153277836947095552, 1153277836947095552]", + "[1153277836947095553, 1153277836947619839]", + "[1153277836947619841, 1153277836948144127]", + "[1153277836948144129, 1153277836950241279]", + "[1153277836950241280, 1153277836950241280]", + "[1153277836950241281, 1153277836952338431]", + "[1153277836952338433, 1153277836954435583]", + "[1153277836954435584, 1153277836954435584]", + "[1153277836954435585, 1153277836962824191]", + "[1153277836962824193, 1153277836971212799]", + "[1153277836971212801, 1153277837004767231]", + "[1153277837004767233, 1153277837038321663]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837092847617, 1153277837094944767]", + "[1153277837105430529, 1153277837239648255]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837340311553, 1153277837373865983]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837373865985, 1153277837407420415]", + "[1153277837407420417, 1153277837440974847]", + "[1153277837440974848, 1153277837440974848]", + "[1153277837440974849, 1153277837474529279]", + "[1153277837474529281, 1153277837482917887]", + "[1153277837482917889, 1153277837491306495]", + "[1153277837491306496, 1153277837491306496]", + "[1153277837491306497, 1153277837499695103]", + "[1153277837499695105, 1153277837500219391]", + "[1153277837500219393, 1153277837500350463]", + "[1153277837500350465, 1153277837500383231]", + "[1153277837500416000, 1153277837500416000]", + "[1153277837500416001, 1153277837500448767]", + "[1153277837500448769, 1153277837500481535]", + "[1153277837500481536, 1153277837500481536]", + "[1153277837500481537, 1153277837500612607]", + "[1153277837500612609, 1153277837500743679]", + "[1153277837500743680, 1153277837500743680]", + "[1153277837500743681, 1153277837501267967]", + "[1153277837501267969, 1153277837501792255]", + "[1153277837501792257, 1153277837503889407]", + "[1153277837503889408, 1153277837503889408]", + "[1153277837503889409, 1153277837505986559]", + "[1153277837541638145, 1153277837543735295]", + "[1153277837545832448, 1153277837545832448]", + "[1153277837545832449, 1153277837547929599]", + "[1153277837547929601, 1153277837550026751]", + "[1153277837550026753, 1153277837558415359]", + "[1153277837558415360, 1153277837558415360]", + "[1153277837558415361, 1153277837566803967]", + "[1153277837575192576, 1153277837575192576]", + "[1153277837583581185, 1153277837591969791]", + "[1153277837591969792, 1153277837591969792]", + "[1153277837591969793, 1153277837600358399]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837709410304, 1153277837709410304]", + "[1153277837717798913, 1153277837726187519]", + "[1153277837726187520, 1153277837726187520]", + "[1153277837726187521, 1153277837734576127]", + "[1153277837734576129, 1153277837736673279]", + "[1153277837736673281, 1153277837738770431]", + "[1153277837738770432, 1153277837738770432]", + "[1153277837740867585, 1153277837742964735]", + "[1153277837784907777, 1153277837793296383]", + "[1153277837793296384, 1153277837793296384]", + "[1153277837793296385, 1153277837801684991]", + "[1153277837801684993, 1153277837810073599]", + "[1153277837810073601, 1153277837843628031]", + "[1153277837843628032, 1153277837843628032]", + "[1153277837843628033, 1153277837877182463]", + "[1153277837877182465, 1153277837910736895]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837910736897, 1153277837944291327]", + "[1153277837977845760, 1153277837977845760]", + "[1153277838044954625, 1153277838179172351]", + "[1153277838179172353, 1153277838313390079]", + "[1153277838313390081, 1153277838321778687]", + "[1153277838321778689, 1153277838330167295]", + "[1153277838330167296, 1153277838330167296]", + "[1153277838330167297, 1153277838332264447]", + "[1153277838332264449, 1153277838334361599]", + "[1153277838334361600, 1153277838334361600]", + "[1153277838334361601, 1153277838336458751]", + "[1153277838336458753, 1153277838336983039]", + "[1153277838336983041, 1153277838337507327]", + "[1153277838337507328, 1153277838337507328]", + "[1153277838337507329, 1153277838338031615]", + "[1153277838380498944, 1153277838380498944]", + "[1153277838380498945, 1153277838414053375]", + "[1153277838414053377, 1153277838447607807]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838447607809, 1153277838481162239]", + "[1153277838481162241, 1153277838514716671]", + "[1153277838514716672, 1153277838514716672]", + "[1153278021252153344, 1153278021252153344]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277832273592320, 1153277832273592320]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833699655681, 1153277833708044287]", + "[1153277835494817792, 1153277835494817792]", + "[1153277835494817793, 1153277836031688703]", + "[1153277836031688705, 1153277836165906431]", + "[1153277836165906433, 1153277836300124159]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836434341889, 1153277836568559615]", + "[1153277836568559616, 1153277836568559616]", + "[1153277836568559617, 1153277836702777343]", + "[1153277836702777345, 1153277836736331775]", + "[1153277836736331777, 1153277836769886207]", + "[1153277836769886208, 1153277836769886208]", + "[1153277836836995072, 1153277836836995072]", + "[1153277837038321664, 1153277837038321664]", + "[1153277837038321665, 1153277837071876095]", + "[1153277837071876097, 1153277837080264703]", + "[1153277837080264705, 1153277837088653311]", + "[1153277837088653312, 1153277837088653312]", + "[1153277837088653313, 1153277837090750463]", + "[1153277837090750465, 1153277837092847615]", + "[1153277837092847616, 1153277837092847616]", + "[1153277837094944769, 1153277837097041919]", + "[1153277837097041921, 1153277837105430527]", + "[1153277837239648257, 1153277837273202687]", + "[1153277837273202689, 1153277837306757119]", + "[1153277837306757120, 1153277837306757120]", + "[1153277837306757121, 1153277837340311551]", + "[1153277837373865984, 1153277837373865984]", + "[1153277837642301440, 1153277837642301440]", + "[1153277837910736896, 1153277837910736896]", + "[1153277837944291329, 1153277837977845759]", + "[1153277837977845760, 1153277837977845760]", + "[1153277837977845761, 1153277838011400191]", + "[1153277838011400193, 1153277838044954623]", + "[1153277838447607808, 1153277838447607808]", + "[1153277838514716672, 1153277838514716672]", + "[1153277838514716673, 1153277838548271103]", + "[1153277838548271105, 1153277838581825535]", + "[1153277838581825537, 1153277838716043263]", + "[1153277838716043265, 1153277838850260991]", + "[1153277838984478720, 1153277838984478720]", + "[1153277839118696449, 1153277839252914175]", + "[1153277839252914177, 1153277839387131903]", + "[1153277839387131905, 1153277839521349631]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839789785088, 1153277839789785088]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278013375250433, 1153278013383639039]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013735960576, 1153278013735960576]", + "[1153278016957186048, 1153278016957186048]", + "[1153278020178411520, 1153278020178411520]", + "[1153278020178411521, 1153278020715282431]", + "[1153278020715282433, 1153278021252153343]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021252153345, 1153278021386371071]", + "[1153278021520588800, 1153278021520588800]", + "[1153278022325895168, 1153278022325895168]", + "[1153278025547120640, 1153278025547120640]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278204325134337, 1153278204862005247]", + "[1153278204862005248, 1153278204862005248]", + "[1153278204862005249, 1153278205398876159]", + "[1153278205935747072, 1153278205935747072]", + "[1153278206606835713, 1153278206741053439]", + "[1153278206741053440, 1153278206741053440]", + "[1153278207009488896, 1153278207009488896]", + "[1153278210230714368, 1153278210230714368]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277827978625024, 1153277827978625024]", + "[1153277829052366848, 1153277829052366848]", + "[1153277829052366849, 1153277829589237759]", + "[1153277829589237761, 1153277830126108671]", + "[1153277832273592320, 1153277832273592320]", + "[1153277832273592321, 1153277832810463231]", + "[1153277832810463233, 1153277833347334143]", + "[1153277833347334144, 1153277833347334144]", + "[1153277833347334145, 1153277833481551871]", + "[1153277833481551873, 1153277833615769599]", + "[1153277833615769600, 1153277833615769600]", + "[1153277833615769601, 1153277833649324031]", + "[1153277833649324033, 1153277833682878463]", + "[1153277833682878464, 1153277833682878464]", + "[1153277833682878465, 1153277833691267071]", + "[1153277833691267073, 1153277833699655679]", + "[1153277833699655680, 1153277833699655680]", + "[1153277833708044289, 1153277833716432895]", + "[1153277833716432897, 1153277833749987327]", + "[1153277833749987329, 1153277833884205055]", + "[1153277833884205057, 1153277834421075967]", + "[1153277834421075969, 1153277834957946879]", + "[1153277834957946881, 1153277835494817791]", + "[1153277835494817792, 1153277835494817792]", + "[1153277836300124160, 1153277836300124160]", + "[1153277836300124161, 1153277836434341887]", + "[1153277836568559616, 1153277836568559616]", + "[1153277838850260993, 1153277838984478719]", + "[1153277838984478720, 1153277838984478720]", + "[1153277838984478721, 1153277839118696447]", + "[1153277839521349632, 1153277839521349632]", + "[1153277839521349633, 1153277839655567359]", + "[1153277839655567361, 1153277839789785087]", + "[1153277839789785088, 1153277839789785088]", + "[1153277839789785089, 1153277840326655999]", + "[1153277840326656001, 1153277840863526911]", + "[1153277840863526913, 1153277841400397823]", + "[1153277841937268736, 1153277841937268736]", + "[1153277842474139649, 1153277843011010559]", + "[1153277845158494208, 1153277845158494208]", + "[1153277952532676608, 1153277952532676608]", + "[1153278004072284160, 1153278004072284160]", + "[1153278012662218753, 1153278013199089663]", + "[1153278013199089665, 1153278013333307391]", + "[1153278013333307393, 1153278013366861823]", + "[1153278013366861825, 1153278013375250431]", + "[1153278013383639040, 1153278013383639040]", + "[1153278013383639041, 1153278013392027647]", + "[1153278013392027649, 1153278013400416255]", + "[1153278013400416256, 1153278013400416256]", + "[1153278013400416257, 1153278013433970687]", + "[1153278013433970689, 1153278013467525119]", + "[1153278013467525120, 1153278013467525120]", + "[1153278013467525121, 1153278013601742847]", + "[1153278013601742849, 1153278013735960575]", + "[1153278013735960576, 1153278013735960576]", + "[1153278013735960577, 1153278014272831487]", + "[1153278014272831489, 1153278014809702399]", + "[1153278016957186048, 1153278016957186048]", + "[1153278016957186049, 1153278017494056959]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018567798785, 1153278019104669695]", + "[1153278019104669697, 1153278019641540607]", + "[1153278019641540609, 1153278020178411519]", + "[1153278020178411520, 1153278020178411520]", + "[1153278021252153344, 1153278021252153344]", + "[1153278021386371073, 1153278021520588799]", + "[1153278021520588800, 1153278021520588800]", + "[1153278021520588801, 1153278021654806527]", + "[1153278021654806529, 1153278021789024255]", + "[1153278021789024257, 1153278022325895167]", + "[1153278022325895168, 1153278022325895168]", + "[1153278022325895169, 1153278022862766079]", + "[1153278022862766081, 1153278023399636991]", + "[1153278023399636993, 1153278023433191423]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023668072448, 1153278023668072448]", + "[1153278024473378816, 1153278024473378816]", + "[1153278025547120640, 1153278025547120640]", + "[1153278028768346112, 1153278028768346112]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029036781569, 1153278029170999295]", + "[1153278038432022528, 1153278038432022528]", + "[1153278089971630080, 1153278089971630080]", + "[1153278202714521600, 1153278202714521600]", + "[1153278202714521601, 1153278203251392511]", + "[1153278203251392513, 1153278203788263423]", + "[1153278203788263425, 1153278204325134335]", + "[1153278204862005248, 1153278204862005248]", + "[1153278205398876161, 1153278205935747071]", + "[1153278205935747072, 1153278205935747072]", + "[1153278205935747073, 1153278206472617983]", + "[1153278206472617985, 1153278206606835711]", + "[1153278206741053440, 1153278206741053440]", + "[1153278206741053441, 1153278206875271167]", + "[1153278206875271169, 1153278207009488895]", + "[1153278207009488896, 1153278207009488896]", + "[1153278207009488897, 1153278207546359807]", + "[1153278207546359809, 1153278208083230719]", + "[1153278208754319361, 1153278208888537087]", + "[1153278208888537088, 1153278208888537088]", + "[1153278209156972544, 1153278209156972544]", + "[1153278210230714368, 1153278210230714368]", + "[1153278213082841089, 1153278213116395519]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213451939840, 1153278213451939840]", + "[1153278214525681664, 1153278214525681664]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277815093723136, 1153277815093723136]", + "[1153277815093723137, 1153277823683657727]", + "[1153277823683657729, 1153277825831141375]", + "[1153277825831141377, 1153277827978625023]", + "[1153277827978625024, 1153277827978625024]", + "[1153277827978625025, 1153277828515495935]", + "[1153277828515495937, 1153277829052366847]", + "[1153277829052366848, 1153277829052366848]", + "[1153277830126108673, 1153277832273592319]", + "[1153277832273592320, 1153277832273592320]", + "[1153277841400397825, 1153277841937268735]", + "[1153277841937268736, 1153277841937268736]", + "[1153277841937268737, 1153277842474139647]", + "[1153277843011010561, 1153277845158494207]", + "[1153277845158494208, 1153277845158494208]", + "[1153277845158494209, 1153277847305977855]", + "[1153277847305977857, 1153277849453461503]", + "[1153277952532676608, 1153277952532676608]", + "[1153277989039898625, 1153277991187382271]", + "[1153277991187382272, 1153277991187382272]", + "[1153277991187382273, 1153277993334865919]", + "[1153277999777316864, 1153277999777316864]", + "[1153278002998542336, 1153278002998542336]", + "[1153278003535413249, 1153278004072284159]", + "[1153278004072284160, 1153278004072284160]", + "[1153278004072284161, 1153278012662218751]", + "[1153278014809702401, 1153278016957186047]", + "[1153278016957186048, 1153278016957186048]", + "[1153278017494056961, 1153278018030927871]", + "[1153278018030927872, 1153278018030927872]", + "[1153278018030927873, 1153278018567798783]", + "[1153278021252153344, 1153278021252153344]", + "[1153278023433191425, 1153278023466745855]", + "[1153278023466745856, 1153278023466745856]", + "[1153278023466745857, 1153278023500300287]", + "[1153278023500300289, 1153278023533854719]", + "[1153278023533854721, 1153278023668072447]", + "[1153278023668072448, 1153278023668072448]", + "[1153278023668072449, 1153278023802290175]", + "[1153278023802290177, 1153278023936507903]", + "[1153278023936507905, 1153278024473378815]", + "[1153278024473378816, 1153278024473378816]", + "[1153278024473378817, 1153278025010249727]", + "[1153278025010249729, 1153278025547120639]", + "[1153278025547120640, 1153278025547120640]", + "[1153278025547120641, 1153278027694604287]", + "[1153278027694604289, 1153278028231475199]", + "[1153278028231475201, 1153278028768346111]", + "[1153278028768346112, 1153278028768346112]", + "[1153278028768346113, 1153278028902563839]", + "[1153278028902563841, 1153278029036781567]", + "[1153278029036781568, 1153278029036781568]", + "[1153278029170999297, 1153278029305217023]", + "[1153278029305217025, 1153278029842087935]", + "[1153278029842087937, 1153278031989571583]", + "[1153278034137055232, 1153278034137055232]", + "[1153278036284538881, 1153278038432022527]", + "[1153278038432022528, 1153278038432022528]", + "[1153278049974747136, 1153278049974747136]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050058633217, 1153278050067021823]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050243182593, 1153278050780053503]", + "[1153278051316924416, 1153278051316924416]", + "[1153278051316924417, 1153278053464408063]", + "[1153278089971630080, 1153278089971630080]", + "[1153278197345812480, 1153278197345812480]", + "[1153278197345812481, 1153278199493296127]", + "[1153278199493296129, 1153278201640779775]", + "[1153278201640779777, 1153278202177650687]", + "[1153278202177650689, 1153278202714521599]", + "[1153278202714521600, 1153278202714521600]", + "[1153278205935747072, 1153278205935747072]", + "[1153278208083230721, 1153278208620101631]", + "[1153278208620101633, 1153278208754319359]", + "[1153278208888537088, 1153278208888537088]", + "[1153278208888537089, 1153278209022754815]", + "[1153278209022754817, 1153278209156972543]", + "[1153278209156972544, 1153278209156972544]", + "[1153278209156972545, 1153278209693843455]", + "[1153278209693843457, 1153278210230714367]", + "[1153278210230714368, 1153278210230714368]", + "[1153278210230714369, 1153278212378198015]", + "[1153278212378198017, 1153278212915068927]", + "[1153278212915068929, 1153278213049286655]", + "[1153278213049286657, 1153278213082841087]", + "[1153278213116395520, 1153278213116395520]", + "[1153278213116395521, 1153278213149949951]", + "[1153278213149949953, 1153278213183504383]", + "[1153278213183504384, 1153278213183504384]", + "[1153278213183504385, 1153278213317722111]", + "[1153278213317722113, 1153278213451939839]", + "[1153278213451939840, 1153278213451939840]", + "[1153278213451939841, 1153278213988810751]", + "[1153278213988810753, 1153278214525681663]", + "[1153278214525681664, 1153278214525681664]", + "[1153278214525681665, 1153278216673165311]", + "[1153278216673165313, 1153278218820648959]", + "[1153278220968132609, 1153278223115616255]", + "[1153278223115616256, 1153278223115616256]", + "[1153278227410583552, 1153278227410583552]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153277746374246400, 1153277746374246400]", + "[1153277763554115584, 1153277763554115584]", + "[1153277763554115585, 1153277772144050175]", + "[1153277780733984769, 1153277815093723135]", + "[1153277815093723136, 1153277815093723136]", + "[1153277849453461505, 1153277883813199871]", + "[1153277883813199873, 1153277918172938239]", + "[1153277935352807424, 1153277935352807424]", + "[1153277948237709312, 1153277948237709312]", + "[1153277950385192961, 1153277952532676607]", + "[1153277952532676608, 1153277952532676608]", + "[1153277952532676609, 1153277961122611199]", + "[1153277969712545792, 1153277969712545792]", + "[1153277978302480385, 1153277986892414975]", + "[1153277986892414977, 1153277989039898623]", + "[1153277991187382272, 1153277991187382272]", + "[1153277993334865921, 1153277995482349567]", + "[1153277995482349569, 1153277997629833215]", + "[1153277997629833217, 1153277999777316863]", + "[1153277999777316864, 1153277999777316864]", + "[1153277999777316865, 1153278001924800511]", + "[1153278001924800513, 1153278002461671423]", + "[1153278002461671425, 1153278002998542335]", + "[1153278002998542336, 1153278002998542336]", + "[1153278002998542337, 1153278003535413247]", + "[1153278004072284160, 1153278004072284160]", + "[1153278021252153344, 1153278021252153344]", + "[1153278031989571585, 1153278034137055231]", + "[1153278034137055232, 1153278034137055232]", + "[1153278034137055233, 1153278036284538879]", + "[1153278038432022528, 1153278038432022528]", + "[1153278038432022529, 1153278047021957119]", + "[1153278047021957121, 1153278049169440767]", + "[1153278049169440769, 1153278049706311679]", + "[1153278049706311681, 1153278049840529407]", + "[1153278049840529409, 1153278049974747135]", + "[1153278049974747136, 1153278049974747136]", + "[1153278049974747137, 1153278050008301567]", + "[1153278050008301569, 1153278050041855999]", + "[1153278050041856000, 1153278050041856000]", + "[1153278050041856001, 1153278050050244607]", + "[1153278050050244609, 1153278050058633215]", + "[1153278050058633216, 1153278050058633216]", + "[1153278050067021825, 1153278050075410431]", + "[1153278050075410433, 1153278050108964863]", + "[1153278050108964865, 1153278050243182591]", + "[1153278050243182592, 1153278050243182592]", + "[1153278050780053505, 1153278051316924415]", + "[1153278051316924416, 1153278051316924416]", + "[1153278053464408065, 1153278055611891711]", + "[1153278055611891713, 1153278064201826303]", + "[1153278072791760896, 1153278072791760896]", + "[1153278081381695489, 1153278089971630079]", + "[1153278089971630080, 1153278089971630080]", + "[1153278089971630081, 1153278090005184511]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090240065536, 1153278090240065536]", + "[1153278091045371904, 1153278091045371904]", + "[1153278094266597376, 1153278094266597376]", + "[1153278107151499264, 1153278107151499264]", + "[1153278132921303041, 1153278141511237631]", + "[1153278141511237632, 1153278141511237632]", + "[1153278141511237633, 1153278150101172223]", + "[1153278175870976000, 1153278175870976000]", + "[1153278175870976001, 1153278184460910591]", + "[1153278184460910593, 1153278193050845183]", + "[1153278193050845185, 1153278195198328831]", + "[1153278195198328833, 1153278197345812479]", + "[1153278197345812480, 1153278197345812480]", + "[1153278210230714368, 1153278210230714368]", + "[1153278218820648961, 1153278220968132607]", + "[1153278223115616256, 1153278223115616256]", + "[1153278223115616257, 1153278225263099903]", + "[1153278225263099905, 1153278227410583551]", + "[1153278227410583552, 1153278227410583552]", + "[1153278227410583553, 1153278261770321919]", + "[1153278270360256513, 1153278278950191103]", + "[1153278278950191104, 1153278278950191104]", + "[1153278845885874176, 1153278845885874176]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274447839363072, 1153274447839363072]", + "[1153274722717270016, 1153274722717270016]", + "[1153274791436746752, 1153274791436746752]", + "[1153274791436746753, 1153274825796485119]", + "[1153276646862618624, 1153276646862618624]", + "[1153276921740525568, 1153276921740525568]", + "[1153277127898955776, 1153277127898955776]", + "[1153277162258694145, 1153277196618432511]", + "[1153277196618432513, 1153277334057385983]", + "[1153277471496339456, 1153277471496339456]", + "[1153277608935292929, 1153277746374246399]", + "[1153277746374246400, 1153277746374246400]", + "[1153277746374246401, 1153277754964180991]", + "[1153277754964180993, 1153277763554115583]", + "[1153277763554115584, 1153277763554115584]", + "[1153277772144050177, 1153277780733984767]", + "[1153277815093723136, 1153277815093723136]", + "[1153277918172938241, 1153277926762872831]", + "[1153277926762872833, 1153277935352807423]", + "[1153277935352807424, 1153277935352807424]", + "[1153277935352807425, 1153277943942742015]", + "[1153277943942742017, 1153277946090225663]", + "[1153277946090225665, 1153277948237709311]", + "[1153277948237709312, 1153277948237709312]", + "[1153277948237709313, 1153277950385192959]", + "[1153277952532676608, 1153277952532676608]", + "[1153277961122611201, 1153277969712545791]", + "[1153277969712545792, 1153277969712545792]", + "[1153277969712545793, 1153277978302480383]", + "[1153278021252153344, 1153278021252153344]", + "[1153278064201826305, 1153278072791760895]", + "[1153278072791760896, 1153278072791760896]", + "[1153278072791760897, 1153278081381695487]", + "[1153278089971630080, 1153278089971630080]", + "[1153278090005184513, 1153278090038738943]", + "[1153278090038738944, 1153278090038738944]", + "[1153278090038738945, 1153278090072293375]", + "[1153278090072293377, 1153278090105847807]", + "[1153278090105847809, 1153278090240065535]", + "[1153278090240065536, 1153278090240065536]", + "[1153278090240065537, 1153278090374283263]", + "[1153278090374283265, 1153278090508500991]", + "[1153278090508500993, 1153278091045371903]", + "[1153278091045371904, 1153278091045371904]", + "[1153278091045371905, 1153278091582242815]", + "[1153278091582242817, 1153278092119113727]", + "[1153278092119113729, 1153278094266597375]", + "[1153278094266597376, 1153278094266597376]", + "[1153278094266597377, 1153278096414081023]", + "[1153278096414081025, 1153278098561564671]", + "[1153278098561564673, 1153278107151499263]", + "[1153278107151499264, 1153278107151499264]", + "[1153278107151499265, 1153278115741433855]", + "[1153278115741433857, 1153278124331368447]", + "[1153278124331368449, 1153278132921303039]", + "[1153278141511237632, 1153278141511237632]", + "[1153278150101172225, 1153278158691106815]", + "[1153278158691106817, 1153278167281041407]", + "[1153278167281041409, 1153278175870975999]", + "[1153278175870976000, 1153278175870976000]", + "[1153278227410583552, 1153278227410583552]", + "[1153278261770321921, 1153278270360256511]", + "[1153278278950191104, 1153278278950191104]", + "[1153278278950191105, 1153278287540125695]", + "[1153278287540125697, 1153278296130060287]", + "[1153278296130060289, 1153278433569013759]", + "[1153278571007967232, 1153278571007967232]", + "[1153278708446920705, 1153278845885874175]", + "[1153278845885874176, 1153278845885874176]", + "[1153278845885874177, 1153278854475808767]", + "[1153278863065743360, 1153278863065743360]", + "[1153278914605350912, 1153278914605350912]", + "[1153279120763781120, 1153279120763781120]", + "[1153279533080641537, 1153279670519595007]", + "[1153279670519595008, 1153279670519595008]", + "[1153279670519595009, 1153279807958548479]", + "[1153280220275408896, 1153280220275408896]", + "[1153280426433839104, 1153280426433839104]", + "[1153280477973446656, 1153280477973446656]", + "[1153280486563381249, 1153280495153315839]", + "[1153280495153315841, 1153280632592269311]", + "[1153280632592269313, 1153280770031222783]", + "[1153280770031222784, 1153280770031222784]", + "[1153281044909129728, 1153281044909129728]", + "[1153290940513779712, 1153290940513779712]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153273348327735296, 1153273348327735296]", + "[1153274172961456128, 1153274172961456128]", + "[1153274241680932864, 1153274241680932864]", + "[1153274241680932865, 1153274276040671231]", + "[1153274447839363072, 1153274447839363072]", + "[1153274447839363073, 1153274585278316543]", + "[1153274585278316545, 1153274722717270015]", + "[1153274722717270016, 1153274722717270016]", + "[1153274722717270017, 1153274757077008383]", + "[1153274757077008385, 1153274791436746751]", + "[1153274791436746752, 1153274791436746752]", + "[1153274825796485121, 1153274860156223487]", + "[1153274860156223489, 1153274997595176959]", + "[1153274997595176961, 1153275031954915327]", + "[1153275066314653696, 1153275066314653696]", + "[1153275272473083904, 1153275272473083904]", + "[1153275684789944321, 1153275822228897791]", + "[1153275822228897792, 1153275822228897792]", + "[1153275822228897793, 1153275959667851263]", + "[1153276371984711680, 1153276371984711680]", + "[1153276578143141888, 1153276578143141888]", + "[1153276629682749440, 1153276629682749440]", + "[1153276638272684033, 1153276646862618623]", + "[1153276646862618624, 1153276646862618624]", + "[1153276646862618625, 1153276784301572095]", + "[1153276784301572097, 1153276921740525567]", + "[1153276921740525568, 1153276921740525568]", + "[1153276921740525569, 1153277059179479039]", + "[1153277059179479041, 1153277093539217407]", + "[1153277093539217409, 1153277127898955775]", + "[1153277127898955776, 1153277127898955776]", + "[1153277127898955777, 1153277162258694143]", + "[1153277334057385985, 1153277471496339455]", + "[1153277471496339456, 1153277471496339456]", + "[1153277471496339457, 1153277608935292927]", + "[1153277746374246400, 1153277746374246400]", + "[1153278433569013761, 1153278571007967231]", + "[1153278571007967232, 1153278571007967232]", + "[1153278571007967233, 1153278708446920703]", + "[1153278845885874176, 1153278845885874176]", + "[1153278854475808769, 1153278863065743359]", + "[1153278863065743360, 1153278863065743360]", + "[1153278863065743361, 1153278871655677951]", + "[1153278871655677953, 1153278880245612543]", + "[1153278880245612545, 1153278914605350911]", + "[1153278914605350912, 1153278914605350912]", + "[1153278914605350913, 1153278948965089279]", + "[1153278948965089281, 1153278983324827647]", + "[1153278983324827649, 1153279120763781119]", + "[1153279120763781120, 1153279120763781120]", + "[1153279120763781121, 1153279258202734591]", + "[1153279258202734593, 1153279395641688063]", + "[1153279395641688065, 1153279533080641535]", + "[1153279670519595008, 1153279670519595008]", + "[1153279807958548481, 1153279945397501951]", + "[1153279945397501953, 1153280082836455423]", + "[1153280082836455425, 1153280220275408895]", + "[1153280220275408896, 1153280220275408896]", + "[1153280220275408897, 1153280357714362367]", + "[1153280357714362369, 1153280392074100735]", + "[1153280392074100737, 1153280426433839103]", + "[1153280426433839104, 1153280426433839104]", + "[1153280426433839105, 1153280460793577471]", + "[1153280460793577473, 1153280469383512063]", + "[1153280469383512065, 1153280477973446655]", + "[1153280477973446656, 1153280477973446656]", + "[1153280477973446657, 1153280486563381247]", + "[1153280770031222784, 1153280770031222784]", + "[1153280770031222785, 1153280907470176255]", + "[1153280907470176257, 1153281044909129727]", + "[1153281044909129728, 1153281044909129728]", + "[1153281044909129729, 1153281182348083199]", + "[1153281182348083201, 1153281319787036671]", + "[1153281319787036672, 1153281319787036672]", + "[1153281775053570049, 1153281783643504639]", + "[1153281783643504640, 1153281783643504640]", + "[1153281800823373824, 1153281800823373824]", + "[1153281869542850560, 1153281869542850560]", + "[1153286542467268608, 1153286542467268608]", + "[1153289841002151936, 1153289841002151936]", + "[1153290115880058880, 1153290115880058880]", + "[1153290115880058881, 1153290253319012351]", + "[1153290253319012353, 1153290390757965823]", + "[1153290940513779712, 1153290940513779712]", + "[1153303035141685248, 1153303035141685248]", + "[1153303035141685249, 1153303584897499135]", + "[1153304134653313024, 1153304134653313024]", + "[1153304867649880065, 1153304867683434495]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867750543360, 1153304867750543360]", + "[1153304868018978816, 1153304868018978816]", + "[1153304869092720640, 1153304869092720640]", + "[1153304873387687936, 1153304873387687936]", + "[1153304890567557120, 1153304890567557120]", + "[1153304959287033856, 1153304959287033856]", + "[1153305234164940800, 1153305234164940800]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153255756141690880, 1153255756141690880]", + "[1153260154188201984, 1153260154188201984]", + "[1153263452723085312, 1153263452723085312]", + "[1153264277356806144, 1153264277356806144]", + "[1153264346076282880, 1153264346076282880]", + "[1153264397615890432, 1153264397615890432]", + "[1153264410500792320, 1153264410500792320]", + "[1153264413722017792, 1153264413722017792]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414787371009, 1153264414795759615]", + "[1153264414795759617, 1153264552234713087]", + "[1153264552234713089, 1153265101990526975]", + "[1153265101990526977, 1153265651746340863]", + "[1153265651746340864, 1153265651746340864]", + "[1153268950281224192, 1153268950281224192]", + "[1153272248816107520, 1153272248816107520]", + "[1153272248816107521, 1153272798571921407]", + "[1153272798571921409, 1153273348327735295]", + "[1153273348327735296, 1153273348327735296]", + "[1153273348327735297, 1153273898083549183]", + "[1153273898083549185, 1153274035522502655]", + "[1153274035522502657, 1153274172961456127]", + "[1153274172961456128, 1153274172961456128]", + "[1153274172961456129, 1153274207321194495]", + "[1153274207321194497, 1153274241680932863]", + "[1153274241680932864, 1153274241680932864]", + "[1153274276040671233, 1153274310400409599]", + "[1153274310400409601, 1153274447839363071]", + "[1153274447839363072, 1153274447839363072]", + "[1153275031954915329, 1153275066314653695]", + "[1153275066314653696, 1153275066314653696]", + "[1153275066314653697, 1153275100674392063]", + "[1153275100674392065, 1153275135034130431]", + "[1153275135034130433, 1153275272473083903]", + "[1153275272473083904, 1153275272473083904]", + "[1153275272473083905, 1153275409912037375]", + "[1153275409912037377, 1153275547350990847]", + "[1153275547350990849, 1153275684789944319]", + "[1153275822228897792, 1153275822228897792]", + "[1153275959667851265, 1153276097106804735]", + "[1153276097106804737, 1153276234545758207]", + "[1153276234545758209, 1153276371984711679]", + "[1153276371984711680, 1153276371984711680]", + "[1153276371984711681, 1153276509423665151]", + "[1153276509423665153, 1153276543783403519]", + "[1153276543783403521, 1153276578143141887]", + "[1153276578143141888, 1153276578143141888]", + "[1153276578143141889, 1153276612502880255]", + "[1153276612502880257, 1153276621092814847]", + "[1153276621092814849, 1153276629682749439]", + "[1153276629682749440, 1153276629682749440]", + "[1153276629682749441, 1153276638272684031]", + "[1153276646862618624, 1153276646862618624]", + "[1153277746374246400, 1153277746374246400]", + "[1153281044909129728, 1153281044909129728]", + "[1153281319787036672, 1153281319787036672]", + "[1153281319787036673, 1153281457225990143]", + "[1153281457225990145, 1153281594664943615]", + "[1153281594664943617, 1153281732103897087]", + "[1153281732103897089, 1153281766463635455]", + "[1153281766463635457, 1153281775053570047]", + "[1153281783643504640, 1153281783643504640]", + "[1153281783643504641, 1153281792233439231]", + "[1153281792233439233, 1153281800823373823]", + "[1153281800823373824, 1153281800823373824]", + "[1153281800823373825, 1153281835183112191]", + "[1153281835183112193, 1153281869542850559]", + "[1153281869542850560, 1153281869542850560]", + "[1153281869542850561, 1153282006981804031]", + "[1153282006981804033, 1153282144420757503]", + "[1153282144420757505, 1153284343444013055]", + "[1153286542467268608, 1153286542467268608]", + "[1153288741490524161, 1153289291246338047]", + "[1153289291246338049, 1153289841002151935]", + "[1153289841002151936, 1153289841002151936]", + "[1153289841002151937, 1153289978441105407]", + "[1153289978441105409, 1153290115880058879]", + "[1153290115880058880, 1153290115880058880]", + "[1153290390757965825, 1153290940513779711]", + "[1153290940513779712, 1153290940513779712]", + "[1153290940513779713, 1153293139537035263]", + "[1153295338560290816, 1153295338560290816]", + "[1153301935630057473, 1153302485385871359]", + "[1153302485385871361, 1153303035141685247]", + "[1153303035141685248, 1153303035141685248]", + "[1153303584897499137, 1153304134653313023]", + "[1153304134653313024, 1153304134653313024]", + "[1153304134653313025, 1153304684409126911]", + "[1153304684409126913, 1153304821848080383]", + "[1153304821848080385, 1153304856207818751]", + "[1153304856207818753, 1153304864797753343]", + "[1153304864797753345, 1153304866945236991]", + "[1153304866945236993, 1153304867482107903]", + "[1153304867482107905, 1153304867616325631]", + "[1153304867616325633, 1153304867649880063]", + "[1153304867683434496, 1153304867683434496]", + "[1153304867683434497, 1153304867716988927]", + "[1153304867716988929, 1153304867750543359]", + "[1153304867750543360, 1153304867750543360]", + "[1153304867750543361, 1153304867884761087]", + "[1153304867884761089, 1153304868018978815]", + "[1153304868018978816, 1153304868018978816]", + "[1153304868018978817, 1153304868555849727]", + "[1153304868555849729, 1153304869092720639]", + "[1153304869092720640, 1153304869092720640]", + "[1153304869092720641, 1153304871240204287]", + "[1153304871240204289, 1153304873387687935]", + "[1153304873387687936, 1153304873387687936]", + "[1153304873387687937, 1153304881977622527]", + "[1153304881977622529, 1153304890567557119]", + "[1153304890567557120, 1153304890567557120]", + "[1153304890567557121, 1153304924927295487]", + "[1153304924927295489, 1153304959287033855]", + "[1153304959287033856, 1153304959287033856]", + "[1153304959287033857, 1153305096725987327]", + "[1153305096725987329, 1153305234164940799]", + "[1153305234164940800, 1153305234164940800]", + "[1153305234164940801, 1153305783920754687]", + "[1153305783920754689, 1153306333676568575]", + "[1153312930746335232, 1153312930746335232]", + "[1153316229281218560, 1153316229281218560]", + "[1153316779037032449, 1153317328792846335]", + "[1153317328792846337, 1153317878548660223]", + "[1153318428304474112, 1153318428304474112]", + "[1153318978060288001, 1153319527816101887]", + "[1153319527816101889, 1153320077571915775]", + "[1153320077571915777, 1153320627327729663]", + "[1153320627327729664, 1153320627327729664]", + "[1153321726839357440, 1153321726839357440]", + "[1153326124885868544, 1153326124885868544]", + "[1154047404513689600, 1154047404513689600]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153202979583557632, 1153202979583557632]", + "[1153220571769602048, 1153220571769602048]", + "[1153220571769602049, 1153229367862624255]", + "[1153255756141690880, 1153255756141690880]", + "[1153255756141690881, 1153257955164946431]", + "[1153257955164946433, 1153260154188201983]", + "[1153260154188201984, 1153260154188201984]", + "[1153260154188201985, 1153262353211457535]", + "[1153262353211457537, 1153262902967271423]", + "[1153262902967271425, 1153263452723085311]", + "[1153263452723085312, 1153263452723085312]", + "[1153263452723085313, 1153264002478899199]", + "[1153264002478899201, 1153264139917852671]", + "[1153264139917852673, 1153264277356806143]", + "[1153264277356806144, 1153264277356806144]", + "[1153264277356806145, 1153264311716544511]", + "[1153264311716544513, 1153264346076282879]", + "[1153264346076282880, 1153264346076282880]", + "[1153264346076282881, 1153264380436021247]", + "[1153264380436021249, 1153264389025955839]", + "[1153264389025955841, 1153264397615890431]", + "[1153264397615890432, 1153264397615890432]", + "[1153264397615890433, 1153264406205825023]", + "[1153264406205825025, 1153264408353308671]", + "[1153264408353308673, 1153264410500792319]", + "[1153264410500792320, 1153264410500792320]", + "[1153264410500792321, 1153264412648275967]", + "[1153264412648275969, 1153264413185146879]", + "[1153264413185146881, 1153264413722017791]", + "[1153264413722017792, 1153264413722017792]", + "[1153264413722017793, 1153264414258888703]", + "[1153264414258888705, 1153264414393106431]", + "[1153264414393106433, 1153264414527324159]", + "[1153264414527324160, 1153264414527324160]", + "[1153264414527324161, 1153264414661541887]", + "[1153264414661541889, 1153264414695096319]", + "[1153264414695096321, 1153264414728650751]", + "[1153264414728650752, 1153264414728650752]", + "[1153264414728650753, 1153264414762205183]", + "[1153264414762205185, 1153264414770593791]", + "[1153264414770593793, 1153264414778982399]", + "[1153264414778982400, 1153264414778982400]", + "[1153264414778982401, 1153264414787371007]", + "[1153265651746340864, 1153265651746340864]", + "[1153265651746340865, 1153266201502154751]", + "[1153266201502154753, 1153266751257968639]", + "[1153266751257968641, 1153268950281224191]", + "[1153268950281224192, 1153268950281224192]", + "[1153268950281224193, 1153271149304479743]", + "[1153271149304479745, 1153271699060293631]", + "[1153271699060293633, 1153272248816107519]", + "[1153272248816107520, 1153272248816107520]", + "[1153273348327735296, 1153273348327735296]", + "[1153284343444013057, 1153286542467268607]", + "[1153286542467268608, 1153286542467268608]", + "[1153286542467268609, 1153288741490524159]", + "[1153290940513779712, 1153290940513779712]", + "[1153293139537035265, 1153295338560290815]", + "[1153295338560290816, 1153295338560290816]", + "[1153295338560290817, 1153297537583546367]", + "[1153297537583546369, 1153299736606801919]", + "[1153299736606801921, 1153301935630057471]", + "[1153304134653313024, 1153304134653313024]", + "[1153306333676568577, 1153308532699824127]", + "[1153308532699824129, 1153310731723079679]", + "[1153310731723079681, 1153312930746335231]", + "[1153312930746335232, 1153312930746335232]", + "[1153312930746335233, 1153315129769590783]", + "[1153315129769590785, 1153315679525404671]", + "[1153315679525404673, 1153316229281218559]", + "[1153316229281218560, 1153316229281218560]", + "[1153316229281218561, 1153316779037032447]", + "[1153317878548660225, 1153318428304474111]", + "[1153318428304474112, 1153318428304474112]", + "[1153318428304474113, 1153318978060287999]", + "[1153320627327729664, 1153320627327729664]", + "[1153320627327729665, 1153321177083543551]", + "[1153321177083543553, 1153321726839357439]", + "[1153321726839357440, 1153321726839357440]", + "[1153321726839357441, 1153323925862612991]", + "[1153323925862612993, 1153326124885868543]", + "[1153326124885868544, 1153326124885868544]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153994627955556352, 1153994627955556352]", + "[1154007822095089664, 1154007822095089664]", + "[1154011120629972992, 1154011120629972992]", + "[1154011670385786881, 1154012220141600767]", + "[1154012220141600769, 1154014419164856319]", + "[1154014419164856321, 1154016618188111871]", + "[1154016618188111872, 1154016618188111872]", + "[1154029812327645184, 1154029812327645184]", + "[1154043006467178496, 1154043006467178496]", + "[1154043006467178497, 1154045205490434047]", + "[1154047404513689600, 1154047404513689600]", + "[1154799470467088384, 1154799470467088384]", + "[1154799470467088385, 1154801669490343935]", + "[1154803868513599488, 1154803868513599488]", + "[1154806067536855041, 1154808266560110591]", + "[1154808266560110592, 1154808266560110592]", + "[1154808266560110593, 1154810465583366143]", + "[1154821460699643904, 1154821460699643904]", + "[1154833005571735553, 1154833555327549439]", + "[1154833555327549440, 1154833555327549440]", + "[1154834654839177216, 1154834654839177216]", + "[1154839052885688320, 1154839052885688320]", + "[1154891829443821568, 1154891829443821568]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1153132610839379968, 1153132610839379968]", + "[1153150203025424384, 1153150203025424384]", + "[1153150203025424385, 1153158999118446591]", + "[1153158999118446593, 1153167795211468799]", + "[1153167795211468801, 1153176591304491007]", + "[1153185387397513216, 1153185387397513216]", + "[1153198581537046528, 1153198581537046528]", + "[1153198581537046529, 1153200780560302079]", + "[1153202979583557632, 1153202979583557632]", + "[1153202979583557633, 1153211775676579839]", + "[1153211775676579841, 1153220571769602047]", + "[1153220571769602048, 1153220571769602048]", + "[1153229367862624257, 1153238163955646463]", + "[1153238163955646465, 1153246960048668671]", + "[1153246960048668673, 1153255756141690879]", + "[1153255756141690880, 1153255756141690880]", + "[1153273348327735296, 1153273348327735296]", + "[1153326124885868544, 1153326124885868544]", + "[1153326124885868545, 1153334920978890751]", + "[1153334920978890753, 1153343717071912959]", + "[1153343717071912961, 1153352513164935167]", + "[1153361309257957376, 1153361309257957376]", + "[1153370105350979585, 1153378901444001791]", + "[1153378901444001793, 1153387697537023999]", + "[1153387697537024001, 1153388247292837887]", + "[1153388797048651776, 1153388797048651776]", + "[1153389621682372608, 1153389621682372608]", + "[1153389690401849344, 1153389690401849344]", + "[1153389707581718528, 1153389707581718528]", + "[1153389711876685824, 1153389711876685824]", + "[1153389712950427648, 1153389712950427648]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713302749185, 1153389713311137791]", + "[1153392095583535104, 1153392095583535104]", + "[1153396493630046208, 1153396493630046208]", + "[1153414085816090624, 1153414085816090624]", + "[1153530634048634881, 1153532833071890431]", + "[1153532833071890432, 1153532833071890432]", + "[1153537231118401536, 1153537231118401536]", + "[1153554823304445952, 1153554823304445952]", + "[1153765929536978944, 1153765929536978944]", + "[1153977035769511936, 1153977035769511936]", + "[1153977035769511937, 1153985831862534143]", + "[1153985831862534145, 1153994627955556351]", + "[1153994627955556352, 1153994627955556352]", + "[1153994627955556353, 1154003424048578559]", + "[1154003424048578561, 1154005623071834111]", + "[1154005623071834113, 1154007822095089663]", + "[1154007822095089664, 1154007822095089664]", + "[1154007822095089665, 1154010021118345215]", + "[1154010021118345217, 1154010570874159103]", + "[1154010570874159105, 1154011120629972991]", + "[1154011120629972992, 1154011120629972992]", + "[1154011120629972993, 1154011670385786879]", + "[1154016618188111872, 1154016618188111872]", + "[1154016618188111873, 1154018817211367423]", + "[1154018817211367425, 1154021016234622975]", + "[1154021016234622977, 1154029812327645183]", + "[1154029812327645184, 1154029812327645184]", + "[1154029812327645185, 1154038608420667391]", + "[1154038608420667393, 1154040807443922943]", + "[1154040807443922945, 1154043006467178495]", + "[1154043006467178496, 1154043006467178496]", + "[1154045205490434049, 1154047404513689599]", + "[1154047404513689600, 1154047404513689600]", + "[1154047404513689601, 1154082588885778431]", + "[1154117773257867264, 1154117773257867264]", + "[1154328879490400256, 1154328879490400256]", + "[1154786276327555073, 1154795072420577279]", + "[1154795072420577281, 1154797271443832831]", + "[1154797271443832833, 1154799470467088383]", + "[1154799470467088384, 1154799470467088384]", + "[1154801669490343937, 1154803868513599487]", + "[1154803868513599488, 1154803868513599488]", + "[1154803868513599489, 1154806067536855039]", + "[1154808266560110592, 1154808266560110592]", + "[1154810465583366145, 1154812664606621695]", + "[1154812664606621697, 1154821460699643903]", + "[1154821460699643904, 1154821460699643904]", + "[1154821460699643905, 1154830256792666111]", + "[1154830256792666113, 1154832455815921663]", + "[1154832455815921665, 1154833005571735551]", + "[1154833555327549440, 1154833555327549440]", + "[1154833555327549441, 1154834105083363327]", + "[1154834105083363329, 1154834654839177215]", + "[1154834654839177216, 1154834654839177216]", + "[1154834654839177217, 1154836853862432767]", + "[1154836853862432769, 1154839052885688319]", + "[1154839052885688320, 1154839052885688320]", + "[1154839052885688321, 1154847848978710527]", + "[1154847848978710529, 1154856645071732735]", + "[1154891829443821568, 1154891829443821568]", + "[1154938008932188161, 1154940207955443711]", + "[1154940207955443712, 1154940207955443712]", + "[1154944606001954816, 1154944606001954816]", + "[1154962198187999232, 1154962198187999232]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 0, + "needTime" : 4, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[1152956688978935809, 1152991873351024639]", + "[1152991873351024640, 1152991873351024640]", + "[1152991873351024641, 1153027057723113471]", + "[1153027057723113473, 1153062242095202303]", + "[1153062242095202305, 1153097426467291135]", + "[1153097426467291137, 1153132610839379967]", + "[1153132610839379968, 1153132610839379968]", + "[1153132610839379969, 1153141406932402175]", + "[1153141406932402177, 1153150203025424383]", + "[1153150203025424384, 1153150203025424384]", + "[1153176591304491009, 1153185387397513215]", + "[1153185387397513216, 1153185387397513216]", + "[1153185387397513217, 1153194183490535423]", + "[1153194183490535425, 1153196382513790975]", + "[1153196382513790977, 1153198581537046527]", + "[1153198581537046528, 1153198581537046528]", + "[1153200780560302081, 1153202979583557631]", + "[1153202979583557632, 1153202979583557632]", + "[1153352513164935169, 1153361309257957375]", + "[1153361309257957376, 1153361309257957376]", + "[1153361309257957377, 1153370105350979583]", + "[1153388247292837889, 1153388797048651775]", + "[1153388797048651776, 1153388797048651776]", + "[1153388797048651777, 1153389346804465663]", + "[1153389346804465665, 1153389484243419135]", + "[1153389484243419137, 1153389621682372607]", + "[1153389621682372608, 1153389621682372608]", + "[1153389621682372609, 1153389656042110975]", + "[1153389656042110977, 1153389690401849343]", + "[1153389690401849344, 1153389690401849344]", + "[1153389690401849345, 1153389698991783935]", + "[1153389698991783937, 1153389707581718527]", + "[1153389707581718528, 1153389707581718528]", + "[1153389707581718529, 1153389709729202175]", + "[1153389709729202177, 1153389711876685823]", + "[1153389711876685824, 1153389711876685824]", + "[1153389711876685825, 1153389712413556735]", + "[1153389712413556737, 1153389712950427647]", + "[1153389712950427648, 1153389712950427648]", + "[1153389712950427649, 1153389713084645375]", + "[1153389713084645377, 1153389713218863103]", + "[1153389713218863104, 1153389713218863104]", + "[1153389713218863105, 1153389713252417535]", + "[1153389713252417537, 1153389713285971967]", + "[1153389713285971968, 1153389713285971968]", + "[1153389713285971969, 1153389713294360575]", + "[1153389713294360577, 1153389713302749183]", + "[1153389713302749184, 1153389713302749184]", + "[1153389713311137793, 1153389713319526399]", + "[1153389713319526401, 1153389713353080831]", + "[1153389713353080833, 1153389713487298559]", + "[1153389713487298561, 1153389714024169471]", + "[1153389714024169473, 1153389716171653119]", + "[1153389716171653121, 1153389724761587711]", + "[1153389724761587713, 1153389759121326079]", + "[1153389759121326081, 1153389896560279551]", + "[1153389896560279553, 1153392095583535103]", + "[1153392095583535104, 1153392095583535104]", + "[1153392095583535105, 1153394294606790655]", + "[1153394294606790657, 1153396493630046207]", + "[1153396493630046208, 1153396493630046208]", + "[1153396493630046209, 1153405289723068415]", + "[1153405289723068417, 1153414085816090623]", + "[1153414085816090624, 1153414085816090624]", + "[1153414085816090625, 1153449270188179455]", + "[1153449270188179457, 1153484454560268287]", + "[1153484454560268289, 1153519638932357119]", + "[1153519638932357121, 1153528435025379327]", + "[1153528435025379329, 1153530634048634879]", + "[1153532833071890432, 1153532833071890432]", + "[1153532833071890433, 1153535032095145983]", + "[1153535032095145985, 1153537231118401535]", + "[1153537231118401536, 1153537231118401536]", + "[1153537231118401537, 1153546027211423743]", + "[1153546027211423745, 1153554823304445951]", + "[1153554823304445952, 1153554823304445952]", + "[1153554823304445953, 1153590007676534783]", + "[1153590007676534785, 1153625192048623615]", + "[1153695560792801280, 1153695560792801280]", + "[1153748337350934528, 1153748337350934528]", + "[1153757133443956737, 1153765929536978943]", + "[1153765929536978944, 1153765929536978944]", + "[1153765929536978945, 1153774725630001151]", + "[1153774725630001153, 1153783521723023359]", + "[1153783521723023360, 1153783521723023360]", + "[1153836298281156608, 1153836298281156608]", + "[1153871482653245441, 1153906667025334271]", + "[1153906667025334273, 1153941851397423103]", + "[1153941851397423105, 1153977035769511935]", + "[1153977035769511936, 1153977035769511936]", + "[1154047404513689600, 1154047404513689600]", + "[1154082588885778433, 1154117773257867263]", + "[1154117773257867264, 1154117773257867264]", + "[1154117773257867265, 1154152957629956095]", + "[1154152957629956097, 1154188142002044927]", + "[1154188142002044929, 1154223326374133759]", + "[1154258510746222592, 1154258510746222592]", + "[1154328879490400256, 1154328879490400256]", + "[1154539985722933248, 1154539985722933248]", + "[1154539985722933249, 1154575170095022079]", + "[1154680723211288576, 1154680723211288576]", + "[1154680723211288577, 1154715907583377407]", + "[1154715907583377409, 1154751091955466239]", + "[1154751091955466241, 1154786276327555071]", + "[1154821460699643904, 1154821460699643904]", + "[1154856645071732737, 1154891829443821567]", + "[1154891829443821568, 1154891829443821568]", + "[1154891829443821569, 1154927013815910399]", + "[1154927013815910401, 1154935809908932607]", + "[1154935809908932609, 1154938008932188159]", + "[1154940207955443712, 1154940207955443712]", + "[1154940207955443713, 1154942406978699263]", + "[1154942406978699265, 1154944606001954815]", + "[1154944606001954816, 1154944606001954816]", + "[1154944606001954817, 1154953402094977023]", + "[1154953402094977025, 1154962198187999231]", + "[1154962198187999232, 1154962198187999232]", + "[1154962198187999233, 1154997382560088063]", + "[1154997382560088065, 1155032566932176895]", + "[1155076547397287937, 1155085343490310143]", + "[1155085343490310144, 1155085343490310144]", + "[1155102935676354560, 1155102935676354560]", + "[1157425104234217472, 1157425104234217472]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]" + ] + }, + "keysExamined" : 4, + "seeks" : 5, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 2, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[382805968326492160, 382805968326492160]", + "[383931868233334784, 383931868233334784]", + "[383931868233334785, 384494818186756095]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1144653177165971457, 1144688361538060287]", + "[1144688361538060288, 1144688361538060288]", + "[1144700078208843777, 1144700112568582143]", + "[1144700112568582144, 1144700112568582144]", + "[1144700181288058880, 1144700181288058880]", + "[1144700456165965824, 1144700456165965824]", + "[1144701555677593600, 1144701555677593600]", + "[1144705953724104704, 1144705953724104704]", + "[1144758730282237952, 1144758730282237952]", + "[1145040205258948608, 1145040205258948608]", + "[1148417904979476480, 1148417904979476480]", + "[1151795604700004352, 1151795604700004352]", + "[1151795604700004353, 1152358554653425663]", + "[1152358554653425665, 1152921504606846975]", + "[1152921504606846977, 1152956688978935807]", + "[1152991873351024640, 1152991873351024640]", + "[1153202979583557632, 1153202979583557632]", + "[1153625192048623617, 1153660376420712447]", + "[1153660376420712449, 1153695560792801279]", + "[1153695560792801280, 1153695560792801280]", + "[1153695560792801281, 1153730745164890111]", + "[1153730745164890113, 1153739541257912319]", + "[1153739541257912321, 1153748337350934527]", + "[1153748337350934528, 1153748337350934528]", + "[1153748337350934529, 1153757133443956735]", + "[1153765929536978944, 1153765929536978944]", + "[1153783521723023360, 1153783521723023360]", + "[1153783521723023361, 1153792317816045567]", + "[1153792317816045569, 1153801113909067775]", + "[1153801113909067777, 1153836298281156607]", + "[1153836298281156608, 1153836298281156608]", + "[1153836298281156609, 1153871482653245439]", + "[1154047404513689600, 1154047404513689600]", + "[1154223326374133761, 1154258510746222591]", + "[1154258510746222592, 1154258510746222592]", + "[1154258510746222593, 1154293695118311423]", + "[1154293695118311425, 1154328879490400255]", + "[1154328879490400256, 1154328879490400256]", + "[1154328879490400257, 1154469616978755583]", + "[1154469616978755585, 1154504801350844415]", + "[1154504801350844417, 1154539985722933247]", + "[1154539985722933248, 1154539985722933248]", + "[1154575170095022081, 1154610354467110911]", + "[1154610354467110913, 1154645538839199743]", + "[1154645538839199745, 1154680723211288575]", + "[1154680723211288576, 1154680723211288576]", + "[1154891829443821568, 1154891829443821568]", + "[1155032566932176897, 1155067751304265727]", + "[1155067751304265729, 1155076547397287935]", + "[1155085343490310144, 1155085343490310144]", + "[1155085343490310145, 1155094139583332351]", + "[1155094139583332353, 1155102935676354559]", + "[1155102935676354560, 1155102935676354560]", + "[1155102935676354561, 1155138120048443391]", + "[1155138120048443393, 1155173304420532223]", + "[1155173304420532225, 1155314041908887551]", + "[1155314041908887553, 1155454779397242879]", + "[1155454779397242880, 1155454779397242880]", + "[1156299204327374848, 1156299204327374848]", + "[1157143629257506816, 1157143629257506816]", + "[1157143629257506817, 1157284366745862143]", + "[1157284366745862145, 1157425104234217471]", + "[1157425104234217472, 1157425104234217472]", + "[1160380591489679361, 1160521328978034687]", + "[1160521328978034688, 1160521328978034688]", + "[1160521328978034689, 1160662066466390015]", + "[1160802803954745344, 1160802803954745344]", + "[1160943541443100673, 1161084278931455999]", + "[1161084278931456000, 1161084278931456000]", + "[1161084278931456001, 1161225016419811327]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1919659341166673920, 1919659341166673920]", + "[1920503766096805888, 1920503766096805888]", + "[1920644503585161217, 1920785241073516543]", + "[1920785241073516545, 1921348191026937855]", + "[1921348191026937857, 1921911140980359167]", + "[1921911140980359168, 1921911140980359168]", + "[1923037040887201792, 1923037040887201792]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 4, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 6, + "advanced" : 3, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[378302368699121664, 378302368699121664]", + "[381680068419649536, 381680068419649536]", + "[381680068419649537, 382243018373070847]", + "[382805968326492160, 382805968326492160]", + "[382805968326492161, 383368918279913471]", + "[383368918279913473, 383931868233334783]", + "[383931868233334784, 383931868233334784]", + "[384494818186756097, 385057768140177407]", + "[385057768140177409, 385620718093598719]", + "[386183668047020032, 386183668047020032]", + "[1080863910568919040, 1080863910568919040]", + "[1134907106097364992, 1134907106097364992]", + "[1143914305352105985, 1144477255305527295]", + "[1144477255305527297, 1144617992793882623]", + "[1144617992793882625, 1144653177165971455]", + "[1144688361538060288, 1144688361538060288]", + "[1144688361538060289, 1144697157631082495]", + "[1144697157631082497, 1144699356654338047]", + "[1144699356654338049, 1144699906410151935]", + "[1144699906410151937, 1144700043849105407]", + "[1144700043849105409, 1144700078208843775]", + "[1144700112568582144, 1144700112568582144]", + "[1144700112568582145, 1144700146928320511]", + "[1144700146928320513, 1144700181288058879]", + "[1144700181288058880, 1144700181288058880]", + "[1144700181288058881, 1144700318727012351]", + "[1144700318727012353, 1144700456165965823]", + "[1144700456165965824, 1144700456165965824]", + "[1144700456165965825, 1144701005921779711]", + "[1144701005921779713, 1144701555677593599]", + "[1144701555677593600, 1144701555677593600]", + "[1144701555677593601, 1144703754700849151]", + "[1144703754700849153, 1144705953724104703]", + "[1144705953724104704, 1144705953724104704]", + "[1144705953724104705, 1144714749817126911]", + "[1144714749817126913, 1144723545910149119]", + "[1144723545910149121, 1144758730282237951]", + "[1144758730282237952, 1144758730282237952]", + "[1144758730282237953, 1144899467770593279]", + "[1144899467770593281, 1145040205258948607]", + "[1145040205258948608, 1145040205258948608]", + "[1145040205258948609, 1145603155212369919]", + "[1145603155212369921, 1146166105165791231]", + "[1147292005072633856, 1147292005072633856]", + "[1148136430002765824, 1148136430002765824]", + "[1148277167491121153, 1148417904979476479]", + "[1148417904979476480, 1148417904979476480]", + "[1148417904979476481, 1148980854932897791]", + "[1149543804886319104, 1149543804886319104]", + "[1150106754839740417, 1150669704793161727]", + "[1150669704793161729, 1151232654746583039]", + "[1151232654746583041, 1151795604700004351]", + "[1151795604700004352, 1151795604700004352]", + "[1155454779397242880, 1155454779397242880]", + "[1155454779397242881, 1155595516885598207]", + "[1155595516885598209, 1155736254373953535]", + "[1155736254373953537, 1156299204327374847]", + "[1156299204327374848, 1156299204327374848]", + "[1156299204327374849, 1156862154280796159]", + "[1156862154280796161, 1157002891769151487]", + "[1157002891769151489, 1157143629257506815]", + "[1157143629257506816, 1157143629257506816]", + "[1157425104234217472, 1157425104234217472]", + "[1157425104234217473, 1159676904047902719]", + "[1159676904047902721, 1160239854001324031]", + "[1160239854001324033, 1160380591489679359]", + "[1160521328978034688, 1160521328978034688]", + "[1160662066466390017, 1160802803954745343]", + "[1160802803954745344, 1160802803954745344]", + "[1160802803954745345, 1160943541443100671]", + "[1161084278931456000, 1161084278931456000]", + "[1161225016419811329, 1161365753908166655]", + "[1161365753908166657, 1161928703861587967]", + "[1170935903116328960, 1170935903116328960]", + "[1224979098644774912, 1224979098644774912]", + "[1918533441259831297, 1919096391213252607]", + "[1919096391213252609, 1919659341166673919]", + "[1919659341166673920, 1919659341166673920]", + "[1919659341166673921, 1920222291120095231]", + "[1920222291120095233, 1920363028608450559]", + "[1920363028608450561, 1920503766096805887]", + "[1920503766096805888, 1920503766096805888]", + "[1920503766096805889, 1920644503585161215]", + "[1921911140980359168, 1921911140980359168]", + "[1921911140980359169, 1922474090933780479]", + "[1922474090933780481, 1923037040887201791]", + "[1923037040887201792, 1923037040887201792]", + "[1923037040887201793, 1923599990840623103]", + "[1923599990840623105, 1924162940794044415]", + "[1924162940794044416, 1924162940794044416]", + "[1925992528142663681, 1926133265631019007]", + "[1926133265631019008, 1926133265631019008]", + "[1926414740607729664, 1926414740607729664]", + "[1927540640514572288, 1927540640514572288]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 5, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[360287970189639680, 360287970189639680]", + "[373798769071751168, 373798769071751168]", + "[373798769071751169, 376050568885436415]", + "[376050568885436417, 376613518838857727]", + "[377176468792279040, 377176468792279040]", + "[378020893722411008, 378020893722411008]", + "[378091262466588672, 378091262466588672]", + "[378091262466588673, 378126446838677503]", + "[378302368699121664, 378302368699121664]", + "[378302368699121665, 380554168512806911]", + "[380554168512806913, 381117118466228223]", + "[381117118466228225, 381680068419649535]", + "[381680068419649536, 381680068419649536]", + "[382243018373070849, 382805968326492159]", + "[382805968326492160, 382805968326492160]", + "[385620718093598721, 386183668047020031]", + "[386183668047020032, 386183668047020032]", + "[386183668047020033, 386746618000441343]", + "[386746618000441345, 387309567953862655]", + "[387309567953862657, 389561367767547903]", + "[389561367767547905, 391813167581233151]", + "[391813167581233152, 391813167581233152]", + "[1080863910568919040, 1080863910568919040]", + "[1119144507401568257, 1121396307215253503]", + "[1121396307215253504, 1121396307215253504]", + "[1121396307215253505, 1123648107028938751]", + "[1130403506469994496, 1130403506469994496]", + "[1133781206190522368, 1133781206190522368]", + "[1134344156143943681, 1134907106097364991]", + "[1134907106097364992, 1134907106097364992]", + "[1134907106097364993, 1143914305352105983]", + "[1146166105165791233, 1146729055119212543]", + "[1146729055119212545, 1147292005072633855]", + "[1147292005072633856, 1147292005072633856]", + "[1147292005072633857, 1147854955026055167]", + "[1147854955026055169, 1147995692514410495]", + "[1147995692514410497, 1148136430002765823]", + "[1148136430002765824, 1148136430002765824]", + "[1148136430002765825, 1148277167491121151]", + "[1148417904979476480, 1148417904979476480]", + "[1148980854932897793, 1149543804886319103]", + "[1149543804886319104, 1149543804886319104]", + "[1149543804886319105, 1150106754839740415]", + "[1161928703861587969, 1170935903116328959]", + "[1170935903116328960, 1170935903116328960]", + "[1170935903116328961, 1173187702930014207]", + "[1175439502743699456, 1175439502743699456]", + "[1179943102371069953, 1188950301625810943]", + "[1224979098644774912, 1224979098644774912]", + "[1909526242005090305, 1918533441259831295]", + "[1923037040887201792, 1923037040887201792]", + "[1924162940794044416, 1924162940794044416]", + "[1924162940794044417, 1924725890747465727]", + "[1924725890747465729, 1925288840700887039]", + "[1925288840700887041, 1925851790654308351]", + "[1925851790654308353, 1925992528142663679]", + "[1926133265631019008, 1926133265631019008]", + "[1926133265631019009, 1926274003119374335]", + "[1926274003119374337, 1926414740607729663]", + "[1926414740607729664, 1926414740607729664]", + "[1926414740607729665, 1926977690561150975]", + "[1926977690561150977, 1927540640514572287]", + "[1927540640514572288, 1927540640514572288]", + "[1927540640514572289, 1929792440328257535]", + "[1929792440328257537, 1932044240141942783]", + "[1932044240141942784, 1932044240141942784]", + "[1939362589536419841, 1939925539489841151]", + "[1939925539489841152, 1939925539489841152]", + "[1941051439396683776, 1941051439396683776]", + "[1945555039024054272, 1945555039024054272]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 5, + "advanced" : 2, + "needTime" : 2, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[342273571680157696, 342273571680157696]", + "[342273571680157697, 351280770934898687]", + "[351280770934898689, 353532570748583935]", + "[355784370562269184, 355784370562269184]", + "[358036170375954433, 360287970189639679]", + "[360287970189639680, 360287970189639680]", + "[360287970189639681, 369295169444380671]", + "[369295169444380673, 371546969258065919]", + "[371546969258065921, 373798769071751167]", + "[373798769071751168, 373798769071751168]", + "[376613518838857729, 377176468792279039]", + "[377176468792279040, 377176468792279040]", + "[377176468792279041, 377739418745700351]", + "[377739418745700353, 377880156234055679]", + "[377880156234055681, 378020893722411007]", + "[378020893722411008, 378020893722411008]", + "[378020893722411009, 378056078094499839]", + "[378056078094499841, 378091262466588671]", + "[378091262466588672, 378091262466588672]", + "[378126446838677505, 378161631210766335]", + "[378161631210766337, 378302368699121663]", + "[378302368699121664, 378302368699121664]", + "[391813167581233152, 391813167581233152]", + "[391813167581233153, 394064967394918399]", + "[394064967394918401, 396316767208603647]", + "[396316767208603649, 405323966463344639]", + "[405323966463344641, 414331165718085631]", + "[414331165718085632, 414331165718085632]", + "[1008806316530991105, 1044835113549955071]", + "[1062849512059437056, 1062849512059437056]", + "[1076360310941548544, 1076360310941548544]", + "[1079738010662076416, 1079738010662076416]", + "[1080300960615497729, 1080863910568919039]", + "[1080863910568919040, 1080863910568919040]", + "[1080863910568919041, 1089871109823660031]", + "[1098878309078401024, 1098878309078401024]", + "[1107885508333142017, 1116892707587883007]", + "[1116892707587883009, 1119144507401568255]", + "[1121396307215253504, 1121396307215253504]", + "[1123648107028938753, 1125899906842623999]", + "[1125899906842624001, 1128151706656309247]", + "[1128151706656309249, 1130403506469994495]", + "[1130403506469994496, 1130403506469994496]", + "[1130403506469994497, 1132655306283679743]", + "[1132655306283679745, 1133218256237101055]", + "[1133218256237101057, 1133781206190522367]", + "[1133781206190522368, 1133781206190522368]", + "[1133781206190522369, 1134344156143943679]", + "[1134907106097364992, 1134907106097364992]", + "[1170935903116328960, 1170935903116328960]", + "[1173187702930014209, 1175439502743699455]", + "[1175439502743699456, 1175439502743699456]", + "[1175439502743699457, 1177691302557384703]", + "[1177691302557384705, 1179943102371069951]", + "[1188950301625810945, 1224979098644774911]", + "[1224979098644774912, 1224979098644774912]", + "[1224979098644774913, 1233986297899515903]", + "[1242993497154256896, 1242993497154256896]", + "[1261007895663738881, 1297036692682702847]", + "[1873497444986126337, 1909526242005090303]", + "[1927540640514572288, 1927540640514572288]", + "[1932044240141942784, 1932044240141942784]", + "[1932044240141942785, 1934296039955628031]", + "[1934296039955628033, 1936547839769313279]", + "[1936547839769313281, 1938799639582998527]", + "[1938799639582998529, 1939362589536419839]", + "[1939925539489841152, 1939925539489841152]", + "[1939925539489841153, 1940488489443262463]", + "[1940488489443262465, 1941051439396683775]", + "[1941051439396683776, 1941051439396683776]", + "[1941051439396683777, 1943303239210369023]", + "[1943303239210369025, 1945555039024054271]", + "[1945555039024054272, 1945555039024054272]", + "[1945555039024054273, 1954562238278795263]", + "[1954562238278795265, 1963569437533536255]", + "[1963569437533536256, 1963569437533536256]", + "[1993405785064865793, 1993968735018287103]", + "[1993968735018287104, 1993968735018287104]", + "[1995094634925129728, 1995094634925129728]", + "[1999598234552500224, 1999598234552500224]" + ] + }, + "keysExamined" : 4, + "seeks" : 3, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[144115188075855873, 288230376151711743]", + "[288230376151711745, 324259173170675711]", + "[324259173170675713, 333266372425416703]", + "[333266372425416705, 342273571680157695]", + "[342273571680157696, 342273571680157696]", + "[353532570748583937, 355784370562269183]", + "[355784370562269184, 355784370562269184]", + "[355784370562269185, 358036170375954431]", + "[360287970189639680, 360287970189639680]", + "[414331165718085632, 414331165718085632]", + "[414331165718085633, 423338364972826623]", + "[423338364972826625, 432345564227567615]", + "[432345564227567617, 468374361246531583]", + "[468374361246531585, 504403158265495551]", + "[504403158265495552, 504403158265495552]", + "[612489549322387457, 648518346341351423]", + "[648518346341351424, 648518346341351424]", + "[648518346341351425, 684547143360315391]", + "[792633534417207296, 792633534417207296]", + "[846676729945653248, 846676729945653248]", + "[860187528827764736, 860187528827764736]", + "[863565228548292608, 863565228548292608]", + "[864128178501713921, 864691128455135231]", + "[864691128455135233, 900719925474099199]", + "[936748722493063168, 936748722493063168]", + "[972777519512027137, 1008806316530991103]", + "[1044835113549955073, 1053842312804696063]", + "[1053842312804696065, 1062849512059437055]", + "[1062849512059437056, 1062849512059437056]", + "[1062849512059437057, 1071856711314178047]", + "[1071856711314178049, 1074108511127863295]", + "[1074108511127863297, 1076360310941548543]", + "[1076360310941548544, 1076360310941548544]", + "[1076360310941548545, 1078612110755233791]", + "[1078612110755233793, 1079175060708655103]", + "[1079175060708655105, 1079738010662076415]", + "[1079738010662076416, 1079738010662076416]", + "[1079738010662076417, 1080300960615497727]", + "[1080863910568919040, 1080863910568919040]", + "[1089871109823660033, 1098878309078401023]", + "[1098878309078401024, 1098878309078401024]", + "[1098878309078401025, 1107885508333142015]", + "[1224979098644774912, 1224979098644774912]", + "[1233986297899515905, 1242993497154256895]", + "[1242993497154256896, 1242993497154256896]", + "[1242993497154256897, 1252000696408997887]", + "[1252000696408997889, 1261007895663738879]", + "[1297036692682702849, 1333065489701666815]", + "[1369094286720630784, 1369094286720630784]", + "[1405123083739594753, 1441151880758558719]", + "[1441151880758558721, 1450159080013299711]", + "[1459166279268040704, 1459166279268040704]", + "[1513209474796486656, 1513209474796486656]", + "[1585267068834414593, 1729382256910270463]", + "[1729382256910270465, 1873497444986126335]", + "[1945555039024054272, 1945555039024054272]", + "[1963569437533536256, 1963569437533536256]", + "[1963569437533536257, 1972576636788277247]", + "[1972576636788277249, 1981583836043018239]", + "[1981583836043018241, 1990591035297759231]", + "[1990591035297759233, 1992842835111444479]", + "[1992842835111444481, 1993405785064865791]", + "[1993968735018287104, 1993968735018287104]", + "[1993968735018287105, 1994531684971708415]", + "[1994531684971708417, 1995094634925129727]", + "[1995094634925129728, 1995094634925129728]", + "[1995094634925129729, 1997346434738814975]", + "[1997346434738814977, 1999598234552500223]", + "[1999598234552500224, 1999598234552500224]", + "[1999598234552500225, 2008605433807241215]", + "[2008605433807241217, 2017612633061982207]", + "[2017612633061982209, 2053641430080946175]", + "[2053641430080946177, 2089670227099910143]", + "[2089670227099910144, 2089670227099910144]", + "[2209578567178649601, 2210141517132070911]", + "[2210141517132070912, 2210141517132070912]", + "[2211267417038913536, 2211267417038913536]", + "[2215771016666284032, 2215771016666284032]", + "[2233785415175766016, 2233785415175766016]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-8502796096475496447, -8358680908399640577]", + "[-8358680908399640575, -8214565720323784705]", + "[-7926335344172072959, -7782220156096217089]", + "[-7782220156096217087, -7638104968020361217]", + "[-5476377146882523135, -5332261958806667265]", + "[-5332261958806667263, -5188146770730811393]", + "[-5188146770730811391, -5044031582654955521]", + "[-4755801206503243775, -4611686018427387905]", + "[1, 144115188075855871]", + "[504403158265495552, 504403158265495552]", + "[504403158265495553, 540431955284459519]", + "[540431955284459521, 576460752303423487]", + "[576460752303423489, 612489549322387455]", + "[648518346341351424, 648518346341351424]", + "[684547143360315393, 720575940379279359]", + "[720575940379279361, 756604737398243327]", + "[756604737398243329, 792633534417207295]", + "[792633534417207296, 792633534417207296]", + "[792633534417207297, 828662331436171263]", + "[828662331436171265, 837669530690912255]", + "[837669530690912257, 846676729945653247]", + "[846676729945653248, 846676729945653248]", + "[846676729945653249, 855683929200394239]", + "[855683929200394241, 857935729014079487]", + "[857935729014079489, 860187528827764735]", + "[860187528827764736, 860187528827764736]", + "[860187528827764737, 862439328641449983]", + "[862439328641449985, 863002278594871295]", + "[863002278594871297, 863565228548292607]", + "[863565228548292608, 863565228548292608]", + "[863565228548292609, 864128178501713919]", + "[900719925474099201, 936748722493063167]", + "[936748722493063168, 936748722493063168]", + "[936748722493063169, 972777519512027135]", + "[1333065489701666817, 1369094286720630783]", + "[1369094286720630784, 1369094286720630784]", + "[1369094286720630785, 1405123083739594751]", + "[1450159080013299713, 1459166279268040703]", + "[1459166279268040704, 1459166279268040704]", + "[1459166279268040705, 1468173478522781695]", + "[1468173478522781697, 1477180677777522687]", + "[1477180677777522689, 1513209474796486655]", + "[1513209474796486656, 1513209474796486656]", + "[1513209474796486657, 1549238271815450623]", + "[1549238271815450625, 1585267068834414591]", + "[2089670227099910144, 2089670227099910144]", + "[2089670227099910145, 2125699024118874111]", + "[2125699024118874113, 2161727821137838079]", + "[2161727821137838081, 2197756618156802047]", + "[2197756618156802049, 2206763817411543039]", + "[2206763817411543041, 2209015617225228287]", + "[2209015617225228289, 2209578567178649599]", + "[2210141517132070912, 2210141517132070912]", + "[2210141517132070913, 2210704467085492223]", + "[2210704467085492225, 2211267417038913535]", + "[2211267417038913536, 2211267417038913536]", + "[2211267417038913537, 2213519216852598783]", + "[2213519216852598785, 2215771016666284031]", + "[2215771016666284032, 2215771016666284032]", + "[2215771016666284033, 2224778215921025023]", + "[2224778215921025025, 2233785415175766015]", + "[2233785415175766016, 2233785415175766016]", + "[2233785415175766017, 2269814212194729983]", + "[2269814212194729985, 2305843009213693951]", + "[2305843009213693953, 2449958197289549823]", + "[2449958197289549825, 2594073385365405695]", + "[4323455642275676161, 4467570830351532031]", + "[4467570830351532033, 4611686018427387903]", + "[4611686018427387905, 4755801206503243775]", + "[5044031582654955521, 5188146770730811391]", + "[5188146770730811393, 5332261958806667263]", + "[5332261958806667265, 5476377146882523135]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[-9223372036854775807, -8646911284551352321]", + "[-8646911284551352319, -8502796096475496449]", + "[-8214565720323784703, -8070450532247928833]", + "[-8070450532247928831, -7926335344172072961]", + "[-7638104968020361215, -7493989779944505345]", + "[-7493989779944505343, -6917529027641081857]", + "[-6917529027641081855, -6341068275337658369]", + "[-6341068275337658367, -5764607523034234881]", + "[-5764607523034234879, -5620492334958379009]", + "[-5620492334958379007, -5476377146882523137]", + "[-5044031582654955519, -4899916394579099649]", + "[-4899916394579099647, -4755801206503243777]", + "[2594073385365405697, 2738188573441261567]", + "[2738188573441261569, 2882303761517117439]", + "[2882303761517117441, 3458764513820540927]", + "[3458764513820540929, 4035225266123964415]", + "[4035225266123964417, 4179340454199820287]", + "[4179340454199820289, 4323455642275676159]", + "[4755801206503243777, 4899916394579099647]", + "[4899916394579099649, 5044031582654955519]", + "[5476377146882523137, 5620492334958379007]", + "[5620492334958379009, 5764607523034234879]", + "[5764607523034234881, 6341068275337658367]", + "[6341068275337658369, 6917529027641081855]", + "[6917529027641081857, 6926536226895822847]", + "[6935543426150563840, 6935543426150563840]", + "[6989586621679009792, 6989586621679009792]", + "[7686096451549528065, 7686237189037883391]", + "[7686237189037883392, 7686237189037883392]", + "[7686518664014594048, 7686518664014594048]", + "[7687644563921436672, 7687644563921436672]", + "[7692148163548807168, 7692148163548807168]", + "[7710162562058289152, 7710162562058289152]", + "[9151314442816847872, 9151314442816847872]", + "[9205357638345293824, 9205357638345293824]", + "[9218868437227405312, 9218868437227405312]", + "[9222246136947933184, 9222246136947933184]", + "[9223090561878065152, 9223090561878065152]", + "[9223231299366420481, 9223372036854775807]" + ] + }, + "keysExamined" : 1, + "seeks" : 2, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + { + "stage" : "FETCH", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 0, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 0, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "loc" : "2dsphere" + }, + "indexName" : "loc_2dsphere", + "isMultiKey" : false, + "multiKeyPaths" : { + "loc" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "loc" : [ + "[6926536226895822849, 6935543426150563839]", + "[6935543426150563840, 6935543426150563840]", + "[6935543426150563841, 6944550625405304831]", + "[6944550625405304833, 6953557824660045823]", + "[6953557824660045825, 6989586621679009791]", + "[6989586621679009792, 6989586621679009792]", + "[6989586621679009793, 7025615418697973759]", + "[7025615418697973761, 7061644215716937727]", + "[7061644215716937729, 7205759403792793599]", + "[7205759403792793601, 7349874591868649471]", + "[7349874591868649473, 7493989779944505343]", + "[7493989779944505345, 7638104968020361215]", + "[7638104968020361217, 7674133765039325183]", + "[7674133765039325185, 7683140964294066175]", + "[7683140964294066177, 7685392764107751423]", + "[7685392764107751425, 7685955714061172735]", + "[7685955714061172737, 7686096451549528063]", + "[7686237189037883392, 7686237189037883392]", + "[7686237189037883393, 7686377926526238719]", + "[7686377926526238721, 7686518664014594047]", + "[7686518664014594048, 7686518664014594048]", + "[7686518664014594049, 7687081613968015359]", + "[7687081613968015361, 7687644563921436671]", + "[7687644563921436672, 7687644563921436672]", + "[7687644563921436673, 7689896363735121919]", + "[7689896363735121921, 7692148163548807167]", + "[7692148163548807168, 7692148163548807168]", + "[7692148163548807169, 7701155362803548159]", + "[7701155362803548161, 7710162562058289151]", + "[7710162562058289152, 7710162562058289152]", + "[7710162562058289153, 7746191359077253119]", + "[7746191359077253121, 7782220156096217087]", + "[7782220156096217089, 7926335344172072959]", + "[7926335344172072961, 8070450532247928831]", + "[8070450532247928833, 8646911284551352319]", + "[8646911284551352321, 8791026472627208191]", + "[8791026472627208193, 8935141660703064063]", + "[8935141660703064065, 9079256848778919935]", + "[9079256848778919937, 9115285645797883903]", + "[9115285645797883905, 9151314442816847871]", + "[9151314442816847872, 9151314442816847872]", + "[9151314442816847873, 9187343239835811839]", + "[9187343239835811841, 9196350439090552831]", + "[9196350439090552833, 9205357638345293823]", + "[9205357638345293824, 9205357638345293824]", + "[9205357638345293825, 9214364837600034815]", + "[9214364837600034817, 9216616637413720063]", + "[9216616637413720065, 9218868437227405311]", + "[9218868437227405312, 9218868437227405312]", + "[9218868437227405313, 9221120237041090559]", + "[9221120237041090561, 9221683186994511871]", + "[9221683186994511873, 9222246136947933183]", + "[9222246136947933184, 9222246136947933184]", + "[9222246136947933185, 9222809086901354495]", + "[9222809086901354497, 9222949824389709823]", + "[9222949824389709825, 9223090561878065151]", + "[9223090561878065152, 9223090561878065152]", + "[9223090561878065153, 9223231299366420479]" + ] + }, + "keysExamined" : 0, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + ] + } + } + }, + "ts" : ISODate("2017-10-15T01:54:55.701Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_2.6.12 b/src/go/tests/doc/out/getmore_2.6.12 new file mode 100644 index 00000000..d50c6fdc --- /dev/null +++ b/src/go/tests/doc/out/getmore_2.6.12 @@ -0,0 +1,33 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "a" : { + "$gt" : 0 + } + }, + "cursorid" : 73529665157, + "ntoreturn" : 2, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(29), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(5), + "w" : NumberLong(4) + } + }, + "nreturned" : 2, + "responseLength" : 86, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:11.360Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.0.15 b/src/go/tests/doc/out/getmore_3.0.15 new file mode 100644 index 00000000..59da152c --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.0.15 @@ -0,0 +1,46 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "a" : { + "$gt" : 0 + } + }, + "cursorid" : 77879406118, + "ntoreturn" : 2, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 20, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:20.995Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.2.16 b/src/go/tests/doc/out/getmore_3.2.16 new file mode 100644 index 00000000..b73ff90c --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.2.16 @@ -0,0 +1,44 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "getMore" : NumberLong("62137702161"), + "collection" : "coll", + "batchSize" : 2 + }, + "cursorid" : 62137702161, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 81, + "protocol" : "op_command", + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:34.569Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.4.7 b/src/go/tests/doc/out/getmore_3.4.7 new file mode 100644 index 00000000..b76612a8 --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.4.7 @@ -0,0 +1,103 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "query" : { + "getMore" : NumberLong("66029137874"), + "collection" : "coll", + "batchSize" : 2 + }, + "originatingCommand" : { + "find" : "coll", + "filter" : { + "a" : { + "$gt" : 0 + } + }, + "batchSize" : 2, + "sort" : { + "a" : 1 + } + }, + "cursorid" : 66029137874, + "keysExamined" : 2, + "docsExamined" : 2, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 2, + "responseLength" : 153, + "protocol" : "op_command", + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 8, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 3, + "restoreState" : 3, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 8, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 8, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 3, + "restoreState" : 3, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "(0.0, inf.0]" + ] + }, + "keysExamined" : 8, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:45.251Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/getmore_3.5.11 b/src/go/tests/doc/out/getmore_3.5.11 new file mode 100644 index 00000000..6b9e77c8 --- /dev/null +++ b/src/go/tests/doc/out/getmore_3.5.11 @@ -0,0 +1,106 @@ +{ + "op" : "getmore", + "ns" : "test.coll", + "command" : { + "getMore" : NumberLong("62495713089"), + "collection" : "coll", + "batchSize" : 2, + "$db" : "test" + }, + "originatingCommand" : { + "find" : "coll", + "filter" : { + "a" : { + "$gt" : 0 + } + }, + "batchSize" : 2, + "sort" : { + "a" : 1 + }, + "$db" : "test" + }, + "cursorid" : 62495713089, + "keysExamined" : 0, + "docsExamined" : 0, + "cursorExhausted" : true, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(1) + } + } + }, + "nreturned" : 0, + "responseLength" : 81, + "protocol" : "op_msg", + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 4, + "restoreState" : 4, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 8, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 8, + "executionTimeMillisEstimate" : 0, + "works" : 9, + "advanced" : 8, + "needTime" : 0, + "needYield" : 0, + "saveState" : 4, + "restoreState" : 4, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "(0.0, inf.0]" + ] + }, + "keysExamined" : 8, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:56.186Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_2.6.12 b/src/go/tests/doc/out/group_2.6.12 new file mode 100644 index 00000000..ccc88964 --- /dev/null +++ b/src/go/tests/doc/out/group_2.6.12 @@ -0,0 +1,41 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : function () {} + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(36629), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(6), + "w" : NumberLong(6) + } + }, + "responseLength" : 135, + "millis" : 36, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:11.599Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.0.15 b/src/go/tests/doc/out/group_3.0.15 new file mode 100644 index 00000000..3f90e354 --- /dev/null +++ b/src/go/tests/doc/out/group_3.0.15 @@ -0,0 +1,54 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : function () {} + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(3) + } + } + }, + "responseLength" : 139, + "millis" : 26, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:21.188Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.2.16 b/src/go/tests/doc/out/group_3.2.16 new file mode 100644 index 00000000..4275f00f --- /dev/null +++ b/src/go/tests/doc/out/group_3.2.16 @@ -0,0 +1,50 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : function () {} + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 142, + "protocol" : "op_command", + "millis" : 31, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:34.867Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.4.7 b/src/go/tests/doc/out/group_3.4.7 new file mode 100644 index 00000000..2604d078 --- /dev/null +++ b/src/go/tests/doc/out/group_3.4.7 @@ -0,0 +1,116 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : { + "code" : "function () {}" + } + } + }, + "keysExamined" : 2, + "docsExamined" : 2, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 124, + "protocol" : "op_command", + "millis" : 31, + "planSummary" : "IXSCAN { b: -1 }", + "execStats" : { + "stage" : "GROUP", + "nReturned" : 1, + "executionTimeMillisEstimate" : 31, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "nGroups" : 2, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : -1 + }, + "indexName" : "b_-1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[3.0, 3.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:45.500Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/group_3.5.11 b/src/go/tests/doc/out/group_3.5.11 new file mode 100644 index 00000000..b79d3224 --- /dev/null +++ b/src/go/tests/doc/out/group_3.5.11 @@ -0,0 +1,117 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "group" : { + "key" : { + "a" : 1, + "b" : 1 + }, + "cond" : { + "b" : 3 + }, + "initial" : { + + }, + "ns" : "coll", + "$reduce" : { + "code" : "function () {}" + } + }, + "$db" : "test" + }, + "keysExamined" : 2, + "docsExamined" : 2, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(6) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3) + } + } + }, + "responseLength" : 124, + "protocol" : "op_msg", + "millis" : 24, + "planSummary" : "IXSCAN { b: -1 }", + "execStats" : { + "stage" : "GROUP", + "nReturned" : 1, + "executionTimeMillisEstimate" : 25, + "works" : 4, + "advanced" : 1, + "needTime" : 3, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "nGroups" : 2, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 2, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 2, + "executionTimeMillisEstimate" : 0, + "works" : 3, + "advanced" : 2, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "b" : -1 + }, + "indexName" : "b_-1", + "isMultiKey" : false, + "multiKeyPaths" : { + "b" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "b" : [ + "[3.0, 3.0]" + ] + }, + "keysExamined" : 2, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:56.478Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_2.6.12 b/src/go/tests/doc/out/insert_2.6.12 new file mode 100644 index 00000000..4073f84c --- /dev/null +++ b/src/go/tests/doc/out/insert_2.6.12 @@ -0,0 +1,28 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "_id" : 1 + }, + "ninserted" : 1, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(362) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(11) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:11.737Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.0.15 b/src/go/tests/doc/out/insert_3.0.15 new file mode 100644 index 00000000..94e5434d --- /dev/null +++ b/src/go/tests/doc/out/insert_3.0.15 @@ -0,0 +1,48 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "_id" : 1 + }, + "ninserted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(2) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(4) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1), + "W" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(2) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(2) + } + } + }, + "millis" : 4, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:21.346Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.2.16 b/src/go/tests/doc/out/insert_3.2.16 new file mode 100644 index 00000000..e033c994 --- /dev/null +++ b/src/go/tests/doc/out/insert_3.2.16 @@ -0,0 +1,47 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "insert" : "coll", + "documents" : [ + { + "_id" : 1 + } + ], + "ordered" : true + }, + "ninserted" : 1, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1), + "W" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1), + "W" : NumberLong(1) + } + } + }, + "responseLength" : 25, + "protocol" : "op_command", + "millis" : 11, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:35.088Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.4.7 b/src/go/tests/doc/out/insert_3.4.7 new file mode 100644 index 00000000..22d2dfb9 --- /dev/null +++ b/src/go/tests/doc/out/insert_3.4.7 @@ -0,0 +1,43 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "query" : { + "insert" : "coll", + "documents" : [ + { + "_id" : 1 + } + ], + "ordered" : true + }, + "ninserted" : 1, + "keysInserted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "w" : NumberLong(3) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(2), + "W" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(2) + } + } + }, + "responseLength" : 29, + "protocol" : "op_command", + "millis" : 11, + "ts" : ISODate("2017-10-15T01:54:45.681Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/insert_3.5.11 b/src/go/tests/doc/out/insert_3.5.11 new file mode 100644 index 00000000..dc1b8872 --- /dev/null +++ b/src/go/tests/doc/out/insert_3.5.11 @@ -0,0 +1,39 @@ +{ + "op" : "insert", + "ns" : "test.coll", + "command" : { + "insert" : "coll", + "ordered" : true, + "$db" : "test" + }, + "ninserted" : 1, + "keysInserted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(3), + "w" : NumberLong(3) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(2), + "W" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(2) + } + } + }, + "responseLength" : 29, + "protocol" : "op_msg", + "millis" : 11, + "ts" : ISODate("2017-10-15T01:54:56.693Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_2.6.12 b/src/go/tests/doc/out/mapreduce_2.6.12 new file mode 100644 index 00000000..41e8a772 --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_2.6.12 @@ -0,0 +1,42 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "mapreduce" : "coll", + "map" : function () { + emit(this.a, this.b); +}, + "reduce" : function (a, b) { + return Array.sum(b); +}, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keyUpdates" : 0, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(650), + "w" : NumberLong(0) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(17), + "w" : NumberLong(15) + } + }, + "responseLength" : 233, + "millis" : 29, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:11.959Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.0.15 b/src/go/tests/doc/out/mapreduce_3.0.15 new file mode 100644 index 00000000..bfd14a96 --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.0.15 @@ -0,0 +1,60 @@ +{ + "op" : "command", + "ns" : "test.$cmd", + "command" : { + "mapreduce" : "coll", + "map" : function () { + emit(this.a, this.b); +}, + "reduce" : function (a, b) { + return Array.sum(b); +}, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(9), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "r" : NumberLong(4), + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1), + "R" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "R" : NumberLong(2), + "W" : NumberLong(1) + } + } + }, + "responseLength" : 233, + "millis" : 21, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:21.559Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.2.16 b/src/go/tests/doc/out/mapreduce_3.2.16 new file mode 100644 index 00000000..b60d4849 --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.2.16 @@ -0,0 +1,60 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "mapreduce" : "coll", + "map" : function () { + emit(this.a, this.b); +}, + "reduce" : function (a, b) { + return Array.sum(b); +}, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keyUpdates" : 0, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(9), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1), + "R" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 218, + "protocol" : "op_command", + "millis" : 41, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:35.348Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.4.7 b/src/go/tests/doc/out/mapreduce_3.4.7 new file mode 100644 index 00000000..8e355963 --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.4.7 @@ -0,0 +1,110 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "mapreduce" : "coll", + "map" : { + "code" : "function () {\n emit(this.a, this.b);\n}" + }, + "reduce" : { + "code" : "function (a, b) {\n return Array.sum(b);\n}" + }, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + } + }, + "keysExamined" : 3, + "docsExamined" : 3, + "numYield" : 1, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(13), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(3), + "w" : NumberLong(1), + "R" : NumberLong(3) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(3), + "w" : NumberLong(1) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 218, + "protocol" : "op_command", + "millis" : 21, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 11, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 11, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[0.0, inf.0]" + ] + }, + "keysExamined" : 3, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:45.925Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/mapreduce_3.5.11 b/src/go/tests/doc/out/mapreduce_3.5.11 new file mode 100644 index 00000000..89063fd7 --- /dev/null +++ b/src/go/tests/doc/out/mapreduce_3.5.11 @@ -0,0 +1,111 @@ +{ + "op" : "command", + "ns" : "test.coll", + "command" : { + "mapreduce" : "coll", + "map" : { + "code" : "function () {\n emit(this.a, this.b);\n}" + }, + "reduce" : { + "code" : "function (a, b) {\n return Array.sum(b);\n}" + }, + "query" : { + "a" : { + "$gte" : 0 + } + }, + "out" : { + "inline" : 1 + }, + "$db" : "test" + }, + "keysExamined" : 3, + "docsExamined" : 3, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(9), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1), + "R" : NumberLong(2) + } + }, + "Collection" : { + "acquireCount" : { + "r" : NumberLong(2), + "w" : NumberLong(1) + } + }, + "Metadata" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "responseLength" : 218, + "protocol" : "op_msg", + "millis" : 26, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "FETCH", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "docsExamined" : 3, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 3, + "executionTimeMillisEstimate" : 0, + "works" : 4, + "advanced" : 3, + "needTime" : 0, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[0.0, inf.0]" + ] + }, + "keysExamined" : 3, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + }, + "ts" : ISODate("2017-10-15T01:54:56.951Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_2.6.12 b/src/go/tests/doc/out/update_2.6.12 new file mode 100644 index 00000000..ce5d69c7 --- /dev/null +++ b/src/go/tests/doc/out/update_2.6.12 @@ -0,0 +1,41 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "numYield" : 0, + "lockStats" : { + "timeLockedMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(241) + }, + "timeAcquiringMicros" : { + "r" : NumberLong(0), + "w" : NumberLong(16) + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:12.161Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.0.15 b/src/go/tests/doc/out/update_3.0.15 new file mode 100644 index 00000000..a20162f7 --- /dev/null +++ b/src/go/tests/doc/out/update_3.0.15 @@ -0,0 +1,55 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "nscanned" : 1, + "nscannedObjects" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "MMAPV1Journal" : { + "acquireCount" : { + "w" : NumberLong(2) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "W" : NumberLong(1) + } + } + }, + "millis" : 0, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:21.803Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.2.16 b/src/go/tests/doc/out/update_3.2.16 new file mode 100644 index 00000000..6837faf8 --- /dev/null +++ b/src/go/tests/doc/out/update_3.2.16 @@ -0,0 +1,50 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "keysExamined" : 1, + "docsExamined" : 1, + "nMatched" : 1, + "nModified" : 1, + "keyUpdates" : 1, + "writeConflicts" : 0, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 2, + "execStats" : { + + }, + "ts" : ISODate("2017-10-15T01:54:35.583Z"), + "client" : "127.0.0.1", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.4.7 b/src/go/tests/doc/out/update_3.4.7 new file mode 100644 index 00000000..67a1b06b --- /dev/null +++ b/src/go/tests/doc/out/update_3.4.7 @@ -0,0 +1,118 @@ +{ + "op" : "update", + "ns" : "test.coll", + "query" : { + "a" : { + "$gte" : 2 + } + }, + "updateobj" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "keysExamined" : 1, + "docsExamined" : 1, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 1, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:46.168Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/out/update_3.5.11 b/src/go/tests/doc/out/update_3.5.11 new file mode 100644 index 00000000..e30d0689 --- /dev/null +++ b/src/go/tests/doc/out/update_3.5.11 @@ -0,0 +1,122 @@ +{ + "op" : "update", + "ns" : "test.coll", + "command" : { + "q" : { + "a" : { + "$gte" : 2 + } + }, + "u" : { + "$set" : { + "c" : 1 + }, + "$inc" : { + "a" : -10 + } + }, + "multi" : false, + "upsert" : false + }, + "keysExamined" : 1, + "docsExamined" : 1, + "nMatched" : 1, + "nModified" : 1, + "keysInserted" : 1, + "keysDeleted" : 1, + "numYield" : 0, + "locks" : { + "Global" : { + "acquireCount" : { + "r" : NumberLong(1), + "w" : NumberLong(1) + } + }, + "Database" : { + "acquireCount" : { + "w" : NumberLong(1) + } + }, + "Collection" : { + "acquireCount" : { + "w" : NumberLong(1) + } + } + }, + "millis" : 0, + "planSummary" : "IXSCAN { a: 1 }", + "execStats" : { + "stage" : "UPDATE", + "nReturned" : 0, + "executionTimeMillisEstimate" : 0, + "works" : 2, + "advanced" : 0, + "needTime" : 1, + "needYield" : 0, + "saveState" : 0, + "restoreState" : 0, + "isEOF" : 1, + "invalidates" : 0, + "nMatched" : 1, + "nWouldModify" : 1, + "nInvalidateSkips" : 0, + "wouldInsert" : false, + "fastmodinsert" : false, + "inputStage" : { + "stage" : "FETCH", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "docsExamined" : 1, + "alreadyHasObj" : 0, + "inputStage" : { + "stage" : "IXSCAN", + "nReturned" : 1, + "executionTimeMillisEstimate" : 0, + "works" : 1, + "advanced" : 1, + "needTime" : 0, + "needYield" : 0, + "saveState" : 1, + "restoreState" : 1, + "isEOF" : 0, + "invalidates" : 0, + "keyPattern" : { + "a" : 1 + }, + "indexName" : "a_1", + "isMultiKey" : false, + "multiKeyPaths" : { + "a" : [ ] + }, + "isUnique" : false, + "isSparse" : false, + "isPartial" : false, + "indexVersion" : 2, + "direction" : "forward", + "indexBounds" : { + "a" : [ + "[2.0, inf.0]" + ] + }, + "keysExamined" : 1, + "seeks" : 1, + "dupsTested" : 0, + "dupsDropped" : 0, + "seenInvalidated" : 0 + } + } + }, + "ts" : ISODate("2017-10-15T01:54:57.231Z"), + "client" : "127.0.0.1", + "appName" : "MongoDB Shell", + "allUsers" : [ ], + "user" : "" +} diff --git a/src/go/tests/doc/run.sh b/src/go/tests/doc/run.sh new file mode 100755 index 00000000..cfa56dcb --- /dev/null +++ b/src/go/tests/doc/run.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e +set -x + +## declare an array of images +declare -a images=( + "mongo:2.6" + "mongo:3.0" + "mongo:3.2" + "mongo:3.4" + "mongo:3.5" +) + +## now loop through the above array of images +for image in "${images[@]}" +do + export MONGO_IMAGE=$image + # clean up old instance if it got left running e.g. after ctrl+c + docker-compose down -v + docker-compose up -d + docker-compose exec mongo sh /script/main.sh + docker-compose down -v +done diff --git a/src/go/tests/doc/script/func/db_version.func b/src/go/tests/doc/script/func/db_version.func new file mode 100644 index 00000000..b79cadd5 --- /dev/null +++ b/src/go/tests/doc/script/func/db_version.func @@ -0,0 +1,5 @@ +#!/bin/sh + +db_version() { + mongo --quiet --eval 'db.version()' +} diff --git a/src/go/tests/doc/script/func/get_single_profile.func b/src/go/tests/doc/script/func/get_single_profile.func new file mode 100644 index 00000000..bb5c8b21 --- /dev/null +++ b/src/go/tests/doc/script/func/get_single_profile.func @@ -0,0 +1,7 @@ +#!/bin/sh + +get_single_profile() { + mongo --quiet <<'EOF' + db.system.profile.find().limit(1).sort( { ts : -1 } ).pretty() +EOF +} diff --git a/src/go/tests/doc/script/func/set_profiling_level.func b/src/go/tests/doc/script/func/set_profiling_level.func new file mode 100644 index 00000000..abf1fe96 --- /dev/null +++ b/src/go/tests/doc/script/func/set_profiling_level.func @@ -0,0 +1,6 @@ +#!/bin/sh + +set_profiling_level() { + mongo --quiet --eval 'db.setProfilingLevel(2)' +} + diff --git a/src/go/tests/doc/script/main.sh b/src/go/tests/doc/script/main.sh new file mode 100755 index 00000000..c33613a7 --- /dev/null +++ b/src/go/tests/doc/script/main.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +set -e +set -x + +DIR=$(dirname "$0") + +# import funcs +for f in $(ls $DIR/func) +do +. "${DIR}/func/${f}" +done + +# wait until mongo is available +until mongo --eval 'db.serverStatus()' > /dev/null +do + sleep 1 +done + +# declare list of profile funcs to run +profiles=$(ls $DIR/profile) + +MONGO_VERSION=$(db_version) +RESULT_DIR=${RESULT_DIR:-/out} + +# turn on profiling +set_profiling_level + +for p in $profiles +do + f="${p%.*}" + cat "${DIR}/profile/${p}" | mongo + get_single_profile > "${RESULT_DIR}/${f}_${MONGO_VERSION}" +done diff --git a/src/go/tests/doc/script/profile/aggregate.js b/src/go/tests/doc/script/profile/aggregate.js new file mode 100644 index 00000000..7d8332a3 --- /dev/null +++ b/src/go/tests/doc/script/profile/aggregate.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i}); +} +coll.createIndex({a: 1}); + +coll.aggregate([{$match: {a: {$gte: 2}}}]); diff --git a/src/go/tests/doc/script/profile/count.js b/src/go/tests/doc/script/profile/count.js new file mode 100644 index 00000000..c547b787 --- /dev/null +++ b/src/go/tests/doc/script/profile/count.js @@ -0,0 +1,8 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i}); +} + +coll.count({}); diff --git a/src/go/tests/doc/script/profile/count_with_query.js b/src/go/tests/doc/script/profile/count_with_query.js new file mode 100644 index 00000000..589e7ffa --- /dev/null +++ b/src/go/tests/doc/script/profile/count_with_query.js @@ -0,0 +1,8 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i}); +} + +coll.count({a: {$gt: 5}}); diff --git a/src/go/tests/doc/script/profile/delete.js b/src/go/tests/doc/script/profile/delete.js new file mode 100644 index 00000000..5261e123 --- /dev/null +++ b/src/go/tests/doc/script/profile/delete.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i, b: i}); +} +coll.createIndex({a: 1}); + +coll.remove({a: {$gte: 2}, b: {$gte: 2}}, {justOne: true}); diff --git a/src/go/tests/doc/script/profile/delete_all.js b/src/go/tests/doc/script/profile/delete_all.js new file mode 100644 index 00000000..4f117cc4 --- /dev/null +++ b/src/go/tests/doc/script/profile/delete_all.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i, b: i}); +} +coll.createIndex({a: 1}); + +coll.remove({a: {$gte: 2}, b: {$gte: 2}}); diff --git a/src/go/tests/doc/script/profile/distinct.js b/src/go/tests/doc/script/profile/distinct.js new file mode 100644 index 00000000..18b4ab69 --- /dev/null +++ b/src/go/tests/doc/script/profile/distinct.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i % 5, b: i}); +} +coll.createIndex({b: 1}); + +coll.distinct("a", {b: {$gte: 5}}); diff --git a/src/go/tests/doc/script/profile/eval.js b/src/go/tests/doc/script/profile/eval.js new file mode 100644 index 00000000..a34d7db4 --- /dev/null +++ b/src/go/tests/doc/script/profile/eval.js @@ -0,0 +1 @@ +db.eval("1"); diff --git a/src/go/tests/doc/script/profile/explain.js b/src/go/tests/doc/script/profile/explain.js new file mode 100644 index 00000000..560c71e3 --- /dev/null +++ b/src/go/tests/doc/script/profile/explain.js @@ -0,0 +1,3 @@ +var coll = db.coll; + +coll.find().explain(); diff --git a/src/go/tests/doc/script/profile/find.js b/src/go/tests/doc/script/profile/find.js new file mode 100644 index 00000000..30f0ea82 --- /dev/null +++ b/src/go/tests/doc/script/profile/find.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({k: i % 5}); +} +coll.createIndex({k: 1}); + +coll.find({k: 1}).toArray(); diff --git a/src/go/tests/doc/script/profile/find_andrii.js b/src/go/tests/doc/script/profile/find_andrii.js new file mode 100644 index 00000000..37e89f56 --- /dev/null +++ b/src/go/tests/doc/script/profile/find_andrii.js @@ -0,0 +1,23 @@ +var coll = db.coll; +coll.drop(); + +coll.find({ + $and: [ + { + k: { $gt: 1 } + }, + { + k: { $lt: 2 } + }, + { + $or: [ + { + c: { $in: [/^0/, /^2/, /^4/, /^6/] } + }, + { + pad: { $in: [/9$/, /7$/, /5$/, /3$/] } + } + ] + } + ] +}).sort({ k: -1 }).limit(100).toArray(); diff --git a/src/go/tests/doc/script/profile/find_empty.js b/src/go/tests/doc/script/profile/find_empty.js new file mode 100644 index 00000000..63d62c1c --- /dev/null +++ b/src/go/tests/doc/script/profile/find_empty.js @@ -0,0 +1,3 @@ +var coll = db.coll; + +coll.find().toArray(); diff --git a/src/go/tests/doc/script/profile/find_with_sort.js b/src/go/tests/doc/script/profile/find_with_sort.js new file mode 100644 index 00000000..4beed84a --- /dev/null +++ b/src/go/tests/doc/script/profile/find_with_sort.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({c: i % 5, b: i}); +} +coll.createIndex({c: 1}); + +coll.find({c: 1}).sort({ b: -1 }).toArray(); diff --git a/src/go/tests/doc/script/profile/findandmodify.js b/src/go/tests/doc/script/profile/findandmodify.js new file mode 100644 index 00000000..47500631 --- /dev/null +++ b/src/go/tests/doc/script/profile/findandmodify.js @@ -0,0 +1,12 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 3; i++) { + coll.insert({_id: i, a: i, b: i}); +} +coll.createIndex({b: 1}); + +coll.findAndModify({ + query: {a: 2}, + update: {$inc: {"b": 1}} +}); diff --git a/src/go/tests/doc/script/profile/geonear.js b/src/go/tests/doc/script/profile/geonear.js new file mode 100644 index 00000000..66f49dff --- /dev/null +++ b/src/go/tests/doc/script/profile/geonear.js @@ -0,0 +1,14 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i, loc: {type: "Point", coordinates: [i, i]}}); +} +coll.createIndex({loc: "2dsphere"}); + +db.runCommand({ + geoNear: "coll", + near: {type: "Point", coordinates: [1, 1]}, + spherical: true +}); + diff --git a/src/go/tests/doc/script/profile/getmore.js b/src/go/tests/doc/script/profile/getmore.js new file mode 100644 index 00000000..611f12ad --- /dev/null +++ b/src/go/tests/doc/script/profile/getmore.js @@ -0,0 +1,14 @@ +var coll = db.coll; +coll.drop(); + +coll.createIndex({a: 1}); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i % 5}); +} + +var cursor = coll.find({a: {$gt: 0}}).sort({a: 1}).batchSize(2); +cursor.next(); // Perform initial query and consume first of 2 docs returned. +cursor.next(); // Consume second of 2 docs from initial query. +cursor.next(); // getMore performed, leaving open cursor. +cursor.itcount(); // Exhaust the cursor. diff --git a/src/go/tests/doc/script/profile/group.js b/src/go/tests/doc/script/profile/group.js new file mode 100644 index 00000000..5a79c0f0 --- /dev/null +++ b/src/go/tests/doc/script/profile/group.js @@ -0,0 +1,14 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i, b: i % 5}); +} +coll.createIndex({b: -1}); + +coll.group({ + key: {a: 1, b: 1}, + cond: {b: 3}, + reduce: function() {}, + initial: {} +}); diff --git a/src/go/tests/doc/script/profile/insert.js b/src/go/tests/doc/script/profile/insert.js new file mode 100644 index 00000000..f9720216 --- /dev/null +++ b/src/go/tests/doc/script/profile/insert.js @@ -0,0 +1,5 @@ +var coll = db.coll; +coll.drop(); + +var doc = {_id: 1}; +var result = coll.insert(doc); diff --git a/src/go/tests/doc/script/profile/mapreduce.js b/src/go/tests/doc/script/profile/mapreduce.js new file mode 100644 index 00000000..902d24f1 --- /dev/null +++ b/src/go/tests/doc/script/profile/mapreduce.js @@ -0,0 +1,19 @@ +var coll = db.coll; +coll.drop(); + +var mapFunction = function() { + emit(this.a, this.b); +}; + +var reduceFunction = function(a, b) { + return Array.sum(b); +}; + +for (var i = 0; i < 3; i++) { + coll.insert({a: i, b: i}); +} +coll.createIndex({a: 1}); + +coll.mapReduce(mapFunction, + reduceFunction, + {query: {a: {$gte: 0}}, out: {inline: 1}}); diff --git a/src/go/tests/doc/script/profile/update.js b/src/go/tests/doc/script/profile/update.js new file mode 100644 index 00000000..50586bf4 --- /dev/null +++ b/src/go/tests/doc/script/profile/update.js @@ -0,0 +1,9 @@ +var coll = db.coll; +coll.drop(); + +for (var i = 0; i < 10; ++i) { + coll.insert({a: i}); +} +coll.createIndex({a: 1}); + +coll.update({a: {$gte: 2}}, {$set: {c: 1}, $inc: {a: -10}}); diff --git a/src/go/tests/expect/available_metrics/available_metrics b/src/go/tests/expect/available_metrics/available_metrics new file mode 100755 index 00000000..db9bf2fc --- /dev/null +++ b/src/go/tests/expect/available_metrics/available_metrics @@ -0,0 +1,421 @@ +{ + "aggregate": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 385 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 385 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 388 + }, + "3.4.7": { + "DocsExamined": 8, + "Millis": 0, + "Nreturned": 8, + "ResponseLength": 370 + }, + "3.5.11": { + "DocsExamined": 8, + "Millis": 2, + "Nreturned": 8, + "ResponseLength": 370 + } + }, + "count": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 48 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 44 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 47 + }, + "3.4.7": { + "DocsExamined": 0, + "Millis": 0, + "ResponseLength": 29 + }, + "3.5.11": { + "DocsExamined": 0, + "Millis": 0, + "ResponseLength": 29 + } + }, + "count_with_query": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 48 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 44 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 47 + }, + "3.4.7": { + "DocsExamined": 10, + "Millis": 0, + "ResponseLength": 29 + }, + "3.5.11": { + "DocsExamined": 10, + "Millis": 0, + "ResponseLength": 29 + } + }, + "delete": { + "2.6.12": { + "Millis": 0 + }, + "3.0.15": { + "Millis": 0 + }, + "3.2.16": { + "Millis": 1 + }, + "3.4.7": { + "DocsExamined": 1, + "Millis": 0 + }, + "3.5.11": { + "DocsExamined": 1, + "Millis": 1 + } + }, + "delete_all": { + "2.6.12": { + "Millis": 0 + }, + "3.0.15": { + "Millis": 0 + }, + "3.2.16": { + "Millis": 1 + }, + "3.4.7": { + "DocsExamined": 8, + "Millis": 1 + }, + "3.5.11": { + "DocsExamined": 8, + "Millis": 1 + } + }, + "distinct": { + "2.6.12": { + "Millis": 0, + "ResponseLength": 199 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 206 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 209 + }, + "3.4.7": { + "DocsExamined": 5, + "Millis": 0, + "ResponseLength": 90 + }, + "3.5.11": { + "DocsExamined": 5, + "Millis": 0, + "ResponseLength": 90 + } + }, + "eval": { + "2.6.12": { + "Millis": 43, + "ResponseLength": 53 + }, + "3.0.15": { + "Millis": 37, + "ResponseLength": 53 + }, + "3.2.16": { + "Millis": 56, + "ResponseLength": 38 + }, + "3.4.7": { + "Millis": 48, + "ResponseLength": 38 + }, + "3.5.11": { + "Millis": 40, + "ResponseLength": 38 + } + }, + "explain": { + "2.6.12": { + "NscannedObjects": 10, + "Millis": 0, + "Nreturned": 1, + "ResponseLength": 583 + }, + "3.0.15": { + "Millis": 0, + "ResponseLength": 379 + }, + "3.2.16": { + "Millis": 0, + "ResponseLength": 364 + }, + "3.4.7": { + "Millis": 0, + "ResponseLength": 328 + }, + "3.5.11": { + "Millis": 0, + "ResponseLength": 329 + } + }, + "find": { + "2.6.12": { + "NscannedObjects": 2, + "Millis": 0, + "Nreturned": 2, + "ResponseLength": 86 + }, + "3.0.15": { + "NscannedObjects": 2, + "Millis": 0, + "Nreturned": 2, + "ResponseLength": 86 + }, + "3.2.16": { + "DocsExamined": 2, + "Millis": 1, + "Nreturned": 2, + "ResponseLength": 172 + }, + "3.4.7": { + "DocsExamined": 2, + "Millis": 0, + "Nreturned": 2, + "ResponseLength": 154 + }, + "3.5.11": { + "DocsExamined": 2, + "Millis": 0, + "Nreturned": 2, + "ResponseLength": 154 + } + }, + "find_andrii": { + "2.6.12": { + "NscannedObjects": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 20 + }, + "3.0.15": { + "NscannedObjects": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 20 + }, + "3.2.16": { + "DocsExamined": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 100 + }, + "3.4.7": { + "DocsExamined": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 82 + }, + "3.5.11": { + "DocsExamined": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 82 + } + }, + "find_empty": { + "2.6.12": { + "NscannedObjects": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 20 + }, + "3.0.15": { + "NscannedObjects": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 20 + }, + "3.2.16": { + "DocsExamined": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 100 + }, + "3.4.7": { + "DocsExamined": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 82 + }, + "3.5.11": { + "DocsExamined": 0, + "Millis": 0, + "Nreturned": 0, + "ResponseLength": 82 + } + }, + "findandmodify": { + "2.6.12": { + "NscannedObjects": 1, + "Millis": 6, + "ResponseLength": 131 + }, + "3.0.15": { + "NscannedObjects": 1, + "Millis": 0, + "ResponseLength": 131 + }, + "3.2.16": { + "DocsExamined": 3, + "Millis": 1, + "ResponseLength": 116 + }, + "3.4.7": { + "DocsExamined": 3, + "Millis": 1, + "ResponseLength": 116 + }, + "3.5.11": { + "DocsExamined": 3, + "Millis": 1, + "ResponseLength": 116 + } + }, + "geonear": { + "2.6.12": { + "Millis": 1, + "ResponseLength": 1406 + }, + "3.0.15": { + "Millis": 2, + "ResponseLength": 1398 + }, + "3.2.16": { + "Millis": 10, + "ResponseLength": 1401 + }, + "3.4.7": { + "DocsExamined": 10, + "Millis": 13, + "ResponseLength": 1383 + }, + "3.5.11": { + "DocsExamined": 10, + "Millis": 11, + "ResponseLength": 1383 + } + }, + "group": { + "2.6.12": { + "Millis": 36, + "ResponseLength": 135 + }, + "3.0.15": { + "Millis": 26, + "ResponseLength": 139 + }, + "3.2.16": { + "Millis": 31, + "ResponseLength": 142 + }, + "3.4.7": { + "DocsExamined": 2, + "Millis": 31, + "ResponseLength": 124 + }, + "3.5.11": { + "DocsExamined": 2, + "Millis": 24, + "ResponseLength": 124 + } + }, + "insert": { + "2.6.12": { + "Millis": 0 + }, + "3.0.15": { + "Millis": 4 + }, + "3.2.16": { + "Millis": 11, + "ResponseLength": 25 + }, + "3.4.7": { + "Millis": 11, + "ResponseLength": 29 + }, + "3.5.11": { + "Millis": 11, + "ResponseLength": 29 + } + }, + "mapreduce": { + "2.6.12": { + "Millis": 29, + "ResponseLength": 233 + }, + "3.0.15": { + "Millis": 21, + "ResponseLength": 233 + }, + "3.2.16": { + "Millis": 41, + "ResponseLength": 218 + }, + "3.4.7": { + "DocsExamined": 3, + "Millis": 21, + "ResponseLength": 218 + }, + "3.5.11": { + "DocsExamined": 3, + "Millis": 26, + "ResponseLength": 218 + } + }, + "update": { + "2.6.12": { + "NscannedObjects": 1, + "Millis": 0 + }, + "3.0.15": { + "NscannedObjects": 1, + "Millis": 0 + }, + "3.2.16": { + "DocsExamined": 1, + "Millis": 2 + }, + "3.4.7": { + "DocsExamined": 1, + "Millis": 0 + }, + "3.5.11": { + "DocsExamined": 1, + "Millis": 0 + } + } +} \ No newline at end of file diff --git a/src/go/tests/expect/available_metrics/cmd_metric b/src/go/tests/expect/available_metrics/cmd_metric new file mode 100755 index 00000000..31ee3e8a --- /dev/null +++ b/src/go/tests/expect/available_metrics/cmd_metric @@ -0,0 +1,252 @@ +{ + "aggregate": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "3.4.7", + "3.5.11" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "count": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "count_with_query": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "delete": { + "Bytes Sent": [ + "no" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "delete_all": { + "Bytes Sent": [ + "no" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "distinct": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "eval": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "no" + ], + "Query Time": [ + "yes" + ] + }, + "explain": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "2.6.12" + ], + "Docs Scanned": [ + "2.6.12" + ], + "Query Time": [ + "yes" + ] + }, + "find": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "yes" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "find_andrii": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "yes" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "find_empty": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "yes" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "findandmodify": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + }, + "geonear": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "group": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "insert": { + "Bytes Sent": [ + "3.2.16", + "3.4.7", + "3.5.11" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "no" + ], + "Query Time": [ + "yes" + ] + }, + "mapreduce": { + "Bytes Sent": [ + "yes" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "3.4.7", + "3.5.11" + ], + "Query Time": [ + "yes" + ] + }, + "update": { + "Bytes Sent": [ + "no" + ], + "Docs Returned": [ + "no" + ], + "Docs Scanned": [ + "yes" + ], + "Query Time": [ + "yes" + ] + } +} \ No newline at end of file diff --git a/src/go/tests/expect/available_metrics/cmd_metric.md b/src/go/tests/expect/available_metrics/cmd_metric.md new file mode 100755 index 00000000..ab6f000b --- /dev/null +++ b/src/go/tests/expect/available_metrics/cmd_metric.md @@ -0,0 +1,19 @@ +| | Bytes Sent | Docs Returned | Docs Scanned | Query Time | +| - | - | - | - | - | +| aggregate | yes | 3.4.7, 3.5.11 | 3.4.7, 3.5.11 | yes | +| count | yes | no | 3.4.7, 3.5.11 | yes | +| count_with_query | yes | no | 3.4.7, 3.5.11 | yes | +| delete | no | no | 3.4.7, 3.5.11 | yes | +| delete_all | no | no | 3.4.7, 3.5.11 | yes | +| distinct | yes | no | 3.4.7, 3.5.11 | yes | +| eval | yes | no | no | yes | +| explain | yes | 2.6.12 | 2.6.12 | yes | +| find | yes | yes | yes | yes | +| find_andrii | yes | yes | yes | yes | +| find_empty | yes | yes | yes | yes | +| findandmodify | yes | no | yes | yes | +| geonear | yes | no | 3.4.7, 3.5.11 | yes | +| group | yes | no | 3.4.7, 3.5.11 | yes | +| insert | 3.2.16, 3.4.7, 3.5.11 | no | no | yes | +| mapreduce | yes | no | 3.4.7, 3.5.11 | yes | +| update | no | no | yes | yes | \ No newline at end of file diff --git a/src/go/tests/expect/stats_all/sum.json b/src/go/tests/expect/stats_all/sum.json new file mode 100755 index 00000000..86d17d30 --- /dev/null +++ b/src/go/tests/expect/stats_all/sum.json @@ -0,0 +1,760 @@ +[ + { + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-10-15T01:54:08.661Z", + "LastSeen": "2017-10-15T01:54:52.564Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 8, + 8 + ], + "NScanned": [ + 0, + 0, + 0, + 8, + 8 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 2 + ], + "ResponseLength": [ + 385, + 385, + 388, + 370, + 370 + ] + }, + { + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-10-15T01:54:08.889Z", + "LastSeen": "2017-10-15T01:54:52.844Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 48, + 44, + 47, + 29, + 29 + ] + }, + { + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-10-15T01:54:09.039Z", + "LastSeen": "2017-10-15T01:54:53.078Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 10, + 10 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 48, + 44, + 47, + 29, + 29 + ] + }, + { + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-10-15T01:54:09.687Z", + "LastSeen": "2017-10-15T01:54:53.874Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 5, + 5 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 199, + 206, + 209, + 90, + 90 + ] + }, + { + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-10-15T01:54:09.89Z", + "LastSeen": "2017-10-15T01:54:54.085Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 43, + 37, + 56, + 48, + 40 + ], + "ResponseLength": [ + 53, + 53, + 38, + 38, + 38 + ] + }, + { + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-10-15T01:54:10.058Z", + "LastSeen": "2017-10-15T01:54:54.257Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 1, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 10, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 583, + 379, + 364, + 328, + 329 + ] + }, + { + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-10-15T01:54:11.011Z", + "LastSeen": "2017-10-15T01:54:55.391Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 1, + 1, + 3, + 3, + 3 + ], + "QueryTime": [ + 6, + 0, + 1, + 1, + 1 + ], + "ResponseLength": [ + 131, + 131, + 116, + 116, + 116 + ] + }, + { + "ID": "2a639e77efe3e68399ef9482575b3421", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-10-15T01:54:10.63Z", + "LastSeen": "2017-10-15T01:54:54.87Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 20, + 20, + 100, + 82, + 82 + ] + }, + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"c\":1},\"orderby\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:10.817Z", + "LastSeen": "2017-10-15T01:54:55.111Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2, + 2, + 2, + 2, + 2 + ], + "NScanned": [ + 2, + 2, + 2, + 2, + 2 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 108, + 108, + 194, + 176, + 176 + ] + }, + { + "ID": "02104210d67fe680273784d833f86831", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-10-15T01:54:10.474Z", + "LastSeen": "2017-10-15T01:54:54.693Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 20, + 20, + 100, + 82, + 82 + ] + }, + { + "ID": "5efe4738d807c74b3980de76c37a0870", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"k\":1}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:10.277Z", + "LastSeen": "2017-10-15T01:54:54.507Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2, + 2, + 2, + 2, + 2 + ], + "NScanned": [ + 2, + 2, + 2, + 2, + 2 + ], + "QueryTime": [ + 0, + 0, + 1, + 0, + 0 + ], + "ResponseLength": [ + 86, + 86, + 172, + 154, + 154 + ] + }, + { + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-10-15T01:54:11.181Z", + "LastSeen": "2017-10-15T01:54:55.701Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 10, + 10 + ], + "QueryTime": [ + 1, + 2, + 10, + 13, + 11 + ], + "ResponseLength": [ + 1406, + 1398, + 1401, + 1383, + 1383 + ] + }, + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"a\":{\"$gt\":0}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:11.36Z", + "LastSeen": "2017-10-15T01:54:56.186Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2, + 0, + 0, + 2, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 2, + 0 + ], + "QueryTime": [ + 0, + 0, + 0, + 0, + 0 + ], + "ResponseLength": [ + 86, + 20, + 81, + 153, + 81 + ] + }, + { + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-10-15T01:54:11.599Z", + "LastSeen": "2017-10-15T01:54:56.478Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 2, + 2 + ], + "QueryTime": [ + 36, + 26, + 31, + 31, + 24 + ], + "ResponseLength": [ + 135, + 139, + 142, + 124, + 124 + ] + }, + { + "ID": "e357abe482dcc0cd03ab742741bf1c86", + "Namespace": "test.coll", + "Operation": "INSERT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-10-15T01:54:11.737Z", + "LastSeen": "2017-10-15T01:54:56.693Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 0, + 0 + ], + "QueryTime": [ + 0, + 4, + 11, + 11, + 11 + ], + "ResponseLength": [ + 0, + 0, + 25, + 29, + 29 + ] + }, + { + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-10-15T01:54:11.959Z", + "LastSeen": "2017-10-15T01:54:56.951Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 3, + 3 + ], + "QueryTime": [ + 29, + 21, + 41, + 21, + 26 + ], + "ResponseLength": [ + 233, + 233, + 218, + 218, + 218 + ] + }, + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:09.246Z", + "LastSeen": "2017-10-15T01:54:53.615Z", + "TableScan": false, + "Count": 10, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 8, + 8 + ], + "QueryTime": [ + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 1 + ], + "ResponseLength": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + { + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", + "Namespace": "test.coll", + "Operation": "UPDATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-10-15T01:54:12.161Z", + "LastSeen": "2017-10-15T01:54:57.231Z", + "TableScan": false, + "Count": 5, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0, + 0, + 0, + 0, + 0 + ], + "NScanned": [ + 1, + 1, + 1, + 1, + 1 + ], + "QueryTime": [ + 0, + 0, + 2, + 0, + 0 + ], + "ResponseLength": [ + 0, + 0, + 0, + 0, + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_2.6.12 b/src/go/tests/expect/stats_single/aggregate_2.6.12 new file mode 100755 index 00000000..d64f3360 --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-10-15T01:54:08.661Z", + "LastSeen": "2017-10-15T01:54:08.661Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 385 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.0.15 b/src/go/tests/expect/stats_single/aggregate_3.0.15 new file mode 100755 index 00000000..bd727fed --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-10-15T01:54:18.509Z", + "LastSeen": "2017-10-15T01:54:18.509Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 385 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.2.16 b/src/go/tests/expect/stats_single/aggregate_3.2.16 new file mode 100755 index 00000000..7e85bb5c --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-10-15T01:54:31.293Z", + "LastSeen": "2017-10-15T01:54:31.293Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 388 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.4.7 b/src/go/tests/expect/stats_single/aggregate_3.4.7 new file mode 100755 index 00000000..f71f3dfb --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{}}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-10-15T01:54:41.948Z", + "LastSeen": "2017-10-15T01:54:41.948Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 8 + ], + "NScanned": [ + 8 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 370 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/aggregate_3.5.11 b/src/go/tests/expect/stats_single/aggregate_3.5.11 new file mode 100755 index 00000000..45275f1e --- /dev/null +++ b/src/go/tests/expect/stats_single/aggregate_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "30dbfbc89efd8cfd40774dff0266a28f", + "Namespace": "test.coll", + "Operation": "AGGREGATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"aggregate\":\"coll\",\"pipeline\":[{\"$match\":{\"a\":{\"$gte\":2}}}],\"cursor\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "AGGREGATE coll a", + "FirstSeen": "2017-10-15T01:54:52.564Z", + "LastSeen": "2017-10-15T01:54:52.564Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 8 + ], + "NScanned": [ + 8 + ], + "QueryTime": [ + 2 + ], + "ResponseLength": [ + 370 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_2.6.12 b/src/go/tests/expect/stats_single/count_2.6.12 new file mode 100755 index 00000000..12a31dcb --- /dev/null +++ b/src/go/tests/expect/stats_single/count_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-10-15T01:54:08.889Z", + "LastSeen": "2017-10-15T01:54:08.889Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 48 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.0.15 b/src/go/tests/expect/stats_single/count_3.0.15 new file mode 100755 index 00000000..3c772bd5 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-10-15T01:54:18.673Z", + "LastSeen": "2017-10-15T01:54:18.673Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 44 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.2.16 b/src/go/tests/expect/stats_single/count_3.2.16 new file mode 100755 index 00000000..f4cf1838 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-10-15T01:54:31.529Z", + "LastSeen": "2017-10-15T01:54:31.529Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 47 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.4.7 b/src/go/tests/expect/stats_single/count_3.4.7 new file mode 100755 index 00000000..867ddd21 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-10-15T01:54:42.157Z", + "LastSeen": "2017-10-15T01:54:42.157Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_3.5.11 b/src/go/tests/expect/stats_single/count_3.5.11 new file mode 100755 index 00000000..a12b11fa --- /dev/null +++ b/src/go/tests/expect/stats_single/count_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "cba2dff0740762c6e5769f0e300df676", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{},\"fields\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "COUNT coll", + "FirstSeen": "2017-10-15T01:54:52.844Z", + "LastSeen": "2017-10-15T01:54:52.844Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_2.6.12 b/src/go/tests/expect/stats_single/count_with_query_2.6.12 new file mode 100755 index 00000000..54e52d62 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-10-15T01:54:09.039Z", + "LastSeen": "2017-10-15T01:54:09.039Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 48 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.0.15 b/src/go/tests/expect/stats_single/count_with_query_3.0.15 new file mode 100755 index 00000000..7d1e1d81 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-10-15T01:54:18.838Z", + "LastSeen": "2017-10-15T01:54:18.838Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 44 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.2.16 b/src/go/tests/expect/stats_single/count_with_query_3.2.16 new file mode 100755 index 00000000..e6cbb692 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-10-15T01:54:31.756Z", + "LastSeen": "2017-10-15T01:54:31.756Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 47 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.4.7 b/src/go/tests/expect/stats_single/count_with_query_3.4.7 new file mode 100755 index 00000000..5c8ced90 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{}}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-10-15T01:54:42.35Z", + "LastSeen": "2017-10-15T01:54:42.35Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/count_with_query_3.5.11 b/src/go/tests/expect/stats_single/count_with_query_3.5.11 new file mode 100755 index 00000000..8a9523a4 --- /dev/null +++ b/src/go/tests/expect/stats_single/count_with_query_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "10b8f47b366fbfd1fb01f8d17d75b1a2", + "Namespace": "test.coll", + "Operation": "COUNT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"count\":\"coll\",\"query\":{\"a\":{\"$gt\":5}},\"fields\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "COUNT coll a", + "FirstSeen": "2017-10-15T01:54:53.078Z", + "LastSeen": "2017-10-15T01:54:53.078Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_2.6.12 b/src/go/tests/expect/stats_single/delete_2.6.12 new file mode 100755 index 00000000..d4cf7929 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:09.246Z", + "LastSeen": "2017-10-15T01:54:09.246Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.0.15 b/src/go/tests/expect/stats_single/delete_3.0.15 new file mode 100755 index 00000000..58f2cbf9 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:19.034Z", + "LastSeen": "2017-10-15T01:54:19.034Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.2.16 b/src/go/tests/expect/stats_single/delete_3.2.16 new file mode 100755 index 00000000..adcfc5c1 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:32.02Z", + "LastSeen": "2017-10-15T01:54:32.02Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.4.7 b/src/go/tests/expect/stats_single/delete_3.4.7 new file mode 100755 index 00000000..35449aa5 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:42.612Z", + "LastSeen": "2017-10-15T01:54:42.612Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_3.5.11 b/src/go/tests/expect/stats_single/delete_3.5.11 new file mode 100755 index 00000000..fb21b711 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":1}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:53.333Z", + "LastSeen": "2017-10-15T01:54:53.333Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_2.6.12 b/src/go/tests/expect/stats_single/delete_all_2.6.12 new file mode 100755 index 00000000..2d739353 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:09.463Z", + "LastSeen": "2017-10-15T01:54:09.463Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.0.15 b/src/go/tests/expect/stats_single/delete_all_3.0.15 new file mode 100755 index 00000000..53995300 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:19.206Z", + "LastSeen": "2017-10-15T01:54:19.206Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.2.16 b/src/go/tests/expect/stats_single/delete_all_3.2.16 new file mode 100755 index 00000000..52b42285 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:32.281Z", + "LastSeen": "2017-10-15T01:54:32.281Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.4.7 b/src/go/tests/expect/stats_single/delete_all_3.4.7 new file mode 100755 index 00000000..86ca7924 --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"query\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:42.82Z", + "LastSeen": "2017-10-15T01:54:42.82Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 8 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/delete_all_3.5.11 b/src/go/tests/expect/stats_single/delete_all_3.5.11 new file mode 100755 index 00000000..ee49d55d --- /dev/null +++ b/src/go/tests/expect/stats_single/delete_all_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "e72ad41302045bd6c2bcad76511f915a", + "Namespace": "test.coll", + "Operation": "REMOVE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"remove\",\"command\":{\"q\":{\"a\":{\"$gte\":2},\"b\":{\"$gte\":2}},\"limit\":0}}\n", + "Fingerprint": "REMOVE coll a,b", + "FirstSeen": "2017-10-15T01:54:53.615Z", + "LastSeen": "2017-10-15T01:54:53.615Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 8 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_2.6.12 b/src/go/tests/expect/stats_single/distinct_2.6.12 new file mode 100755 index 00000000..f2e3106b --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-10-15T01:54:09.687Z", + "LastSeen": "2017-10-15T01:54:09.687Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 199 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.0.15 b/src/go/tests/expect/stats_single/distinct_3.0.15 new file mode 100755 index 00000000..281541e3 --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-10-15T01:54:19.38Z", + "LastSeen": "2017-10-15T01:54:19.38Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 206 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.2.16 b/src/go/tests/expect/stats_single/distinct_3.2.16 new file mode 100755 index 00000000..9ea9a80d --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-10-15T01:54:32.523Z", + "LastSeen": "2017-10-15T01:54:32.523Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 209 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.4.7 b/src/go/tests/expect/stats_single/distinct_3.4.7 new file mode 100755 index 00000000..92c16a2a --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}}}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-10-15T01:54:43.048Z", + "LastSeen": "2017-10-15T01:54:43.048Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 5 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 90 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/distinct_3.5.11 b/src/go/tests/expect/stats_single/distinct_3.5.11 new file mode 100755 index 00000000..f8d9e57b --- /dev/null +++ b/src/go/tests/expect/stats_single/distinct_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "e4122a58c99ab0a4020ce7d195c5a8cb", + "Namespace": "test.coll", + "Operation": "DISTINCT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"distinct\":\"coll\",\"key\":\"a\",\"query\":{\"b\":{\"$gte\":5}},\"$db\":\"test\"}}\n", + "Fingerprint": "DISTINCT coll a,b", + "FirstSeen": "2017-10-15T01:54:53.874Z", + "LastSeen": "2017-10-15T01:54:53.874Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 5 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 90 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_2.6.12 b/src/go/tests/expect/stats_single/eval_2.6.12 new file mode 100755 index 00000000..af410ea5 --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-10-15T01:54:09.89Z", + "LastSeen": "2017-10-15T01:54:09.89Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 43 + ], + "ResponseLength": [ + 53 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.0.15 b/src/go/tests/expect/stats_single/eval_3.0.15 new file mode 100755 index 00000000..93735c33 --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-10-15T01:54:19.572Z", + "LastSeen": "2017-10-15T01:54:19.572Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 37 + ], + "ResponseLength": [ + 53 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.2.16 b/src/go/tests/expect/stats_single/eval_3.2.16 new file mode 100755 index 00000000..7564171f --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-10-15T01:54:32.759Z", + "LastSeen": "2017-10-15T01:54:32.759Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 56 + ], + "ResponseLength": [ + 38 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.4.7 b/src/go/tests/expect/stats_single/eval_3.4.7 new file mode 100755 index 00000000..da0361ef --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"1\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-10-15T01:54:43.273Z", + "LastSeen": "2017-10-15T01:54:43.273Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 48 + ], + "ResponseLength": [ + 38 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/eval_3.5.11 b/src/go/tests/expect/stats_single/eval_3.5.11 new file mode 100755 index 00000000..b0e5e433 --- /dev/null +++ b/src/go/tests/expect/stats_single/eval_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "a6782ae38ef891d5506341a4b0ab2747", + "Namespace": "test", + "Operation": "EVAL", + "Query": "{\"ns\":\"test\",\"op\":\"command\",\"command\":{\"$eval\":\"1\",\"$db\":\"test\"}}\n", + "Fingerprint": "EVAL", + "FirstSeen": "2017-10-15T01:54:54.085Z", + "LastSeen": "2017-10-15T01:54:54.085Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 40 + ], + "ResponseLength": [ + 38 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_2.6.12 b/src/go/tests/expect/stats_single/explain_2.6.12 new file mode 100755 index 00000000..bbd5d938 --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{},\"$explain\":true}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-10-15T01:54:10.058Z", + "LastSeen": "2017-10-15T01:54:10.058Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 1 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 583 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.0.15 b/src/go/tests/expect/stats_single/explain_3.0.15 new file mode 100755 index 00000000..48bc0d34 --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{},\"options\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-10-15T01:54:19.722Z", + "LastSeen": "2017-10-15T01:54:19.722Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 379 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.2.16 b/src/go/tests/expect/stats_single/explain_3.2.16 new file mode 100755 index 00000000..a271a1e6 --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-10-15T01:54:32.931Z", + "LastSeen": "2017-10-15T01:54:32.931Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 364 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.4.7 b/src/go/tests/expect/stats_single/explain_3.4.7 new file mode 100755 index 00000000..518b15fa --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-10-15T01:54:43.427Z", + "LastSeen": "2017-10-15T01:54:43.427Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 328 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/explain_3.5.11 b/src/go/tests/expect/stats_single/explain_3.5.11 new file mode 100755 index 00000000..9d80c538 --- /dev/null +++ b/src/go/tests/expect/stats_single/explain_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "76d7662df07b44135ac3e07e44a6eb39", + "Namespace": "", + "Operation": "EXPLAIN", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"explain\":{\"find\":\"coll\",\"filter\":{}},\"verbosity\":\"queryPlanner\",\"$db\":\"test\"}}\n", + "Fingerprint": "EXPLAIN", + "FirstSeen": "2017-10-15T01:54:54.257Z", + "LastSeen": "2017-10-15T01:54:54.257Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 329 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_2.6.12 b/src/go/tests/expect/stats_single/find_2.6.12 new file mode 100755 index 00000000..63f5f9ed --- /dev/null +++ b/src/go/tests/expect/stats_single/find_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "5efe4738d807c74b3980de76c37a0870", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"k\":1}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:10.277Z", + "LastSeen": "2017-10-15T01:54:10.277Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 86 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.0.15 b/src/go/tests/expect/stats_single/find_3.0.15 new file mode 100755 index 00000000..7e7b4507 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "5efe4738d807c74b3980de76c37a0870", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"k\":1}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:19.953Z", + "LastSeen": "2017-10-15T01:54:19.953Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 86 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.2.16 b/src/go/tests/expect/stats_single/find_3.2.16 new file mode 100755 index 00000000..df47999c --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "5efe4738d807c74b3980de76c37a0870", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"k\":1}}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:33.179Z", + "LastSeen": "2017-10-15T01:54:33.179Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 172 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.4.7 b/src/go/tests/expect/stats_single/find_3.4.7 new file mode 100755 index 00000000..d641eb93 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "5efe4738d807c74b3980de76c37a0870", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"k\":1}}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:43.713Z", + "LastSeen": "2017-10-15T01:54:43.713Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 154 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_3.5.11 b/src/go/tests/expect/stats_single/find_3.5.11 new file mode 100755 index 00000000..2a1a004e --- /dev/null +++ b/src/go/tests/expect/stats_single/find_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "5efe4738d807c74b3980de76c37a0870", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"k\":1},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll k", + "FirstSeen": "2017-10-15T01:54:54.507Z", + "LastSeen": "2017-10-15T01:54:54.507Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 154 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_2.6.12 b/src/go/tests/expect/stats_single/find_andrii_2.6.12 new file mode 100755 index 00000000..aeda265e --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "02104210d67fe680273784d833f86831", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-10-15T01:54:10.474Z", + "LastSeen": "2017-10-15T01:54:10.474Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.0.15 b/src/go/tests/expect/stats_single/find_andrii_3.0.15 new file mode 100755 index 00000000..f7cba294 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "02104210d67fe680273784d833f86831", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"orderby\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-10-15T01:54:20.111Z", + "LastSeen": "2017-10-15T01:54:20.111Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.2.16 b/src/go/tests/expect/stats_single/find_andrii_3.2.16 new file mode 100755 index 00000000..00826af3 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "02104210d67fe680273784d833f86831", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-10-15T01:54:33.358Z", + "LastSeen": "2017-10-15T01:54:33.358Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 100 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.4.7 b/src/go/tests/expect/stats_single/find_andrii_3.4.7 new file mode 100755 index 00000000..d109b603 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "02104210d67fe680273784d833f86831", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1}}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-10-15T01:54:43.922Z", + "LastSeen": "2017-10-15T01:54:43.922Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 82 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_andrii_3.5.11 b/src/go/tests/expect/stats_single/find_andrii_3.5.11 new file mode 100755 index 00000000..57a9d35a --- /dev/null +++ b/src/go/tests/expect/stats_single/find_andrii_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "02104210d67fe680273784d833f86831", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"$and\":[{\"k\":{\"$gt\":1}},{\"k\":{\"$lt\":2}},{\"$or\":[{\"c\":{\"$in\":[\"/^0/\",\"/^2/\",\"/^4/\",\"/^6/\"]}},{\"pad\":{\"$in\":[\"/9$/\",\"/7$/\",\"/5$/\",\"/3$/\"]}}]}]},\"limit\":100,\"singleBatch\":false,\"sort\":{\"k\":-1},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll c,k,pad", + "FirstSeen": "2017-10-15T01:54:54.693Z", + "LastSeen": "2017-10-15T01:54:54.693Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 82 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_2.6.12 b/src/go/tests/expect/stats_single/find_empty_2.6.12 new file mode 100755 index 00000000..8d2f5c99 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "2a639e77efe3e68399ef9482575b3421", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-10-15T01:54:10.63Z", + "LastSeen": "2017-10-15T01:54:10.63Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.0.15 b/src/go/tests/expect/stats_single/find_empty_3.0.15 new file mode 100755 index 00000000..adad3b50 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "2a639e77efe3e68399ef9482575b3421", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\"}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-10-15T01:54:20.246Z", + "LastSeen": "2017-10-15T01:54:20.246Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.2.16 b/src/go/tests/expect/stats_single/find_empty_3.2.16 new file mode 100755 index 00000000..f4308c9b --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "2a639e77efe3e68399ef9482575b3421", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-10-15T01:54:33.53Z", + "LastSeen": "2017-10-15T01:54:33.53Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 100 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.4.7 b/src/go/tests/expect/stats_single/find_empty_3.4.7 new file mode 100755 index 00000000..6c9a2caf --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "2a639e77efe3e68399ef9482575b3421", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{}}}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-10-15T01:54:44.129Z", + "LastSeen": "2017-10-15T01:54:44.129Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 82 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_empty_3.5.11 b/src/go/tests/expect/stats_single/find_empty_3.5.11 new file mode 100755 index 00000000..937152ea --- /dev/null +++ b/src/go/tests/expect/stats_single/find_empty_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "2a639e77efe3e68399ef9482575b3421", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll", + "FirstSeen": "2017-10-15T01:54:54.87Z", + "LastSeen": "2017-10-15T01:54:54.87Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 82 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_2.6.12 b/src/go/tests/expect/stats_single/find_with_sort_2.6.12 new file mode 100755 index 00000000..71dbb104 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"c\":1},\"orderby\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:10.817Z", + "LastSeen": "2017-10-15T01:54:10.817Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 108 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.0.15 b/src/go/tests/expect/stats_single/find_with_sort_3.0.15 new file mode 100755 index 00000000..47318d5e --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"query\":{\"c\":1},\"orderby\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:20.41Z", + "LastSeen": "2017-10-15T01:54:20.41Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 108 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.2.16 b/src/go/tests/expect/stats_single/find_with_sort_3.2.16 new file mode 100755 index 00000000..c1df885f --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"c\":1},\"sort\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:33.762Z", + "LastSeen": "2017-10-15T01:54:33.762Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 194 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.4.7 b/src/go/tests/expect/stats_single/find_with_sort_3.4.7 new file mode 100755 index 00000000..36fb38f9 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"query\":{\"find\":\"coll\",\"filter\":{\"c\":1},\"sort\":{\"b\":-1}}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:44.423Z", + "LastSeen": "2017-10-15T01:54:44.423Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 176 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/find_with_sort_3.5.11 b/src/go/tests/expect/stats_single/find_with_sort_3.5.11 new file mode 100755 index 00000000..736491a6 --- /dev/null +++ b/src/go/tests/expect/stats_single/find_with_sort_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "20fe80188ec82c9d3c3dcf3f4817f8f9", + "Namespace": "test.coll", + "Operation": "FIND", + "Query": "{\"ns\":\"test.coll\",\"op\":\"query\",\"command\":{\"find\":\"coll\",\"filter\":{\"c\":1},\"sort\":{\"b\":-1},\"$db\":\"test\"}}\n", + "Fingerprint": "FIND coll b,c", + "FirstSeen": "2017-10-15T01:54:55.111Z", + "LastSeen": "2017-10-15T01:54:55.111Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 176 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_2.6.12 b/src/go/tests/expect/stats_single/findandmodify_2.6.12 new file mode 100755 index 00000000..595cbc6c --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-10-15T01:54:11.011Z", + "LastSeen": "2017-10-15T01:54:11.011Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 6 + ], + "ResponseLength": [ + 131 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.0.15 b/src/go/tests/expect/stats_single/findandmodify_3.0.15 new file mode 100755 index 00000000..c8b17bf8 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-10-15T01:54:20.581Z", + "LastSeen": "2017-10-15T01:54:20.581Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 131 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.2.16 b/src/go/tests/expect/stats_single/findandmodify_3.2.16 new file mode 100755 index 00000000..ca6e28c0 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-10-15T01:54:34.011Z", + "LastSeen": "2017-10-15T01:54:34.011Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 116 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.4.7 b/src/go/tests/expect/stats_single/findandmodify_3.4.7 new file mode 100755 index 00000000..d81c37a1 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}}},\"updateobj\":{\"$inc\":{\"b\":1}}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-10-15T01:54:44.656Z", + "LastSeen": "2017-10-15T01:54:44.656Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 116 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/findandmodify_3.5.11 b/src/go/tests/expect/stats_single/findandmodify_3.5.11 new file mode 100755 index 00000000..12858348 --- /dev/null +++ b/src/go/tests/expect/stats_single/findandmodify_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "e8a3f05a4bd3f0bfa7d38eb2372258b1", + "Namespace": "test.coll", + "Operation": "FINDANDMODIFY", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"findandmodify\":\"coll\",\"query\":{\"a\":2},\"update\":{\"$inc\":{\"b\":1}},\"$db\":\"test\"}}\n", + "Fingerprint": "FINDANDMODIFY coll a", + "FirstSeen": "2017-10-15T01:54:55.391Z", + "LastSeen": "2017-10-15T01:54:55.391Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 116 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_2.6.12 b/src/go/tests/expect/stats_single/geonear_2.6.12 new file mode 100755 index 00000000..cc9e30be --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-10-15T01:54:11.181Z", + "LastSeen": "2017-10-15T01:54:11.181Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 1 + ], + "ResponseLength": [ + 1406 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.0.15 b/src/go/tests/expect/stats_single/geonear_3.0.15 new file mode 100755 index 00000000..d9c6f994 --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-10-15T01:54:20.751Z", + "LastSeen": "2017-10-15T01:54:20.751Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 2 + ], + "ResponseLength": [ + 1398 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.2.16 b/src/go/tests/expect/stats_single/geonear_3.2.16 new file mode 100755 index 00000000..f312b472 --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-10-15T01:54:34.27Z", + "LastSeen": "2017-10-15T01:54:34.27Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 10 + ], + "ResponseLength": [ + 1401 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.4.7 b/src/go/tests/expect/stats_single/geonear_3.4.7 new file mode 100755 index 00000000..6e1dd370 --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-10-15T01:54:44.873Z", + "LastSeen": "2017-10-15T01:54:44.873Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 13 + ], + "ResponseLength": [ + 1383 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/geonear_3.5.11 b/src/go/tests/expect/stats_single/geonear_3.5.11 new file mode 100755 index 00000000..0798c825 --- /dev/null +++ b/src/go/tests/expect/stats_single/geonear_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "c70403cbd55ffbb07f08c0cb77a24b19", + "Namespace": "test.coll", + "Operation": "GEONEAR", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"geoNear\":\"coll\",\"near\":{\"type\":\"Point\",\"coordinates\":[1,1]},\"spherical\":true,\"$db\":\"test\"}}\n", + "Fingerprint": "GEONEAR coll", + "FirstSeen": "2017-10-15T01:54:55.701Z", + "LastSeen": "2017-10-15T01:54:55.701Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 10 + ], + "QueryTime": [ + 11 + ], + "ResponseLength": [ + 1383 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_2.6.12 b/src/go/tests/expect/stats_single/getmore_2.6.12 new file mode 100755 index 00000000..317b24ab --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"a\":{\"$gt\":0}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:11.36Z", + "LastSeen": "2017-10-15T01:54:11.36Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 86 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.0.15 b/src/go/tests/expect/stats_single/getmore_3.0.15 new file mode 100755 index 00000000..58571ebe --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"a\":{\"$gt\":0}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:20.995Z", + "LastSeen": "2017-10-15T01:54:20.995Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 20 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.2.16 b/src/go/tests/expect/stats_single/getmore_3.2.16 new file mode 100755 index 00000000..0524524a --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"getMore\":\"62137702161\",\"collection\":\"coll\",\"batchSize\":2}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:34.569Z", + "LastSeen": "2017-10-15T01:54:34.569Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 81 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.4.7 b/src/go/tests/expect/stats_single/getmore_3.4.7 new file mode 100755 index 00000000..3c572e12 --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"query\":{\"getMore\":\"66029137874\",\"collection\":\"coll\",\"batchSize\":2},\"originatingCommand\":{\"find\":\"coll\",\"filter\":{\"a\":{\"$gt\":0}},\"batchSize\":2,\"sort\":{\"a\":1}}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:45.251Z", + "LastSeen": "2017-10-15T01:54:45.251Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 2 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 153 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/getmore_3.5.11 b/src/go/tests/expect/stats_single/getmore_3.5.11 new file mode 100755 index 00000000..66551a8a --- /dev/null +++ b/src/go/tests/expect/stats_single/getmore_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "db759bfd83441deecc71382323041ce6", + "Namespace": "test.coll", + "Operation": "GETMORE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"getmore\",\"command\":{\"getMore\":\"62495713089\",\"collection\":\"coll\",\"batchSize\":2,\"$db\":\"test\"},\"originatingCommand\":{\"find\":\"coll\",\"filter\":{\"a\":{\"$gt\":0}},\"batchSize\":2,\"sort\":{\"a\":1},\"$db\":\"test\"}}\n", + "Fingerprint": "GETMORE coll", + "FirstSeen": "2017-10-15T01:54:56.186Z", + "LastSeen": "2017-10-15T01:54:56.186Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 81 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_2.6.12 b/src/go/tests/expect/stats_single/group_2.6.12 new file mode 100755 index 00000000..03e19b99 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-10-15T01:54:11.599Z", + "LastSeen": "2017-10-15T01:54:11.599Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 36 + ], + "ResponseLength": [ + 135 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.0.15 b/src/go/tests/expect/stats_single/group_3.0.15 new file mode 100755 index 00000000..60387fad --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-10-15T01:54:21.188Z", + "LastSeen": "2017-10-15T01:54:21.188Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 26 + ], + "ResponseLength": [ + 139 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.2.16 b/src/go/tests/expect/stats_single/group_3.2.16 new file mode 100755 index 00000000..4a813772 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":\"\"}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-10-15T01:54:34.867Z", + "LastSeen": "2017-10-15T01:54:34.867Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 31 + ], + "ResponseLength": [ + 142 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.4.7 b/src/go/tests/expect/stats_single/group_3.4.7 new file mode 100755 index 00000000..00408d13 --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}}}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-10-15T01:54:45.5Z", + "LastSeen": "2017-10-15T01:54:45.5Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 31 + ], + "ResponseLength": [ + 124 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/group_3.5.11 b/src/go/tests/expect/stats_single/group_3.5.11 new file mode 100755 index 00000000..48c2970e --- /dev/null +++ b/src/go/tests/expect/stats_single/group_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "ca8bb19386488570447f5753741fb494", + "Namespace": "test.coll", + "Operation": "GROUP", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"group\":{\"key\":{\"a\":1,\"b\":1},\"cond\":{\"b\":3},\"initial\":{},\"ns\":\"coll\",\"$reduce\":{\"code\":\"function () {}\"}},\"$db\":\"test\"}}\n", + "Fingerprint": "GROUP coll a,b", + "FirstSeen": "2017-10-15T01:54:56.478Z", + "LastSeen": "2017-10-15T01:54:56.478Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 2 + ], + "QueryTime": [ + 24 + ], + "ResponseLength": [ + 124 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_2.6.12 b/src/go/tests/expect/stats_single/insert_2.6.12 new file mode 100755 index 00000000..821f4847 --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "e357abe482dcc0cd03ab742741bf1c86", + "Namespace": "test.coll", + "Operation": "INSERT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-10-15T01:54:11.737Z", + "LastSeen": "2017-10-15T01:54:11.737Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.0.15 b/src/go/tests/expect/stats_single/insert_3.0.15 new file mode 100755 index 00000000..23cda336 --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "e357abe482dcc0cd03ab742741bf1c86", + "Namespace": "test.coll", + "Operation": "INSERT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"_id\":1}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-10-15T01:54:21.346Z", + "LastSeen": "2017-10-15T01:54:21.346Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 4 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.2.16 b/src/go/tests/expect/stats_single/insert_3.2.16 new file mode 100755 index 00000000..296b8be2 --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "e357abe482dcc0cd03ab742741bf1c86", + "Namespace": "test.coll", + "Operation": "INSERT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-10-15T01:54:35.088Z", + "LastSeen": "2017-10-15T01:54:35.088Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 11 + ], + "ResponseLength": [ + 25 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.4.7 b/src/go/tests/expect/stats_single/insert_3.4.7 new file mode 100755 index 00000000..4049f3d3 --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "e357abe482dcc0cd03ab742741bf1c86", + "Namespace": "test.coll", + "Operation": "INSERT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"query\":{\"insert\":\"coll\",\"documents\":[{\"_id\":1}],\"ordered\":true}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-10-15T01:54:45.681Z", + "LastSeen": "2017-10-15T01:54:45.681Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 11 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/insert_3.5.11 b/src/go/tests/expect/stats_single/insert_3.5.11 new file mode 100755 index 00000000..3e856227 --- /dev/null +++ b/src/go/tests/expect/stats_single/insert_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "e357abe482dcc0cd03ab742741bf1c86", + "Namespace": "test.coll", + "Operation": "INSERT", + "Query": "{\"ns\":\"test.coll\",\"op\":\"insert\",\"command\":{\"insert\":\"coll\",\"ordered\":true,\"$db\":\"test\"}}\n", + "Fingerprint": "INSERT coll", + "FirstSeen": "2017-10-15T01:54:56.693Z", + "LastSeen": "2017-10-15T01:54:56.693Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 11 + ], + "ResponseLength": [ + 29 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_2.6.12 b/src/go/tests/expect/stats_single/mapreduce_2.6.12 new file mode 100755 index 00000000..aa6e82a1 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-10-15T01:54:11.959Z", + "LastSeen": "2017-10-15T01:54:11.959Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 29 + ], + "ResponseLength": [ + 233 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.0.15 b/src/go/tests/expect/stats_single/mapreduce_3.0.15 new file mode 100755 index 00000000..808098d4 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", + "Query": "{\"ns\":\"test.$cmd\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-10-15T01:54:21.559Z", + "LastSeen": "2017-10-15T01:54:21.559Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 21 + ], + "ResponseLength": [ + 233 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.2.16 b/src/go/tests/expect/stats_single/mapreduce_3.2.16 new file mode 100755 index 00000000..ed6c0364 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":\"\",\"reduce\":\"\",\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-10-15T01:54:35.348Z", + "LastSeen": "2017-10-15T01:54:35.348Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 0 + ], + "QueryTime": [ + 41 + ], + "ResponseLength": [ + 218 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.4.7 b/src/go/tests/expect/stats_single/mapreduce_3.4.7 new file mode 100755 index 00000000..5a80d7ba --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1}}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-10-15T01:54:45.925Z", + "LastSeen": "2017-10-15T01:54:45.925Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 21 + ], + "ResponseLength": [ + 218 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/mapreduce_3.5.11 b/src/go/tests/expect/stats_single/mapreduce_3.5.11 new file mode 100755 index 00000000..a682b8f0 --- /dev/null +++ b/src/go/tests/expect/stats_single/mapreduce_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "cc3cb3824eea4094eb042f5ca76bd385", + "Namespace": "test.coll", + "Operation": "MAPREDUCE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"command\",\"command\":{\"mapreduce\":\"coll\",\"map\":{\"code\":\"function () {\\n emit(this.a, this.b);\\n}\"},\"reduce\":{\"code\":\"function (a, b) {\\n return Array.sum(b);\\n}\"},\"query\":{\"a\":{\"$gte\":0}},\"out\":{\"inline\":1},\"$db\":\"test\"}}\n", + "Fingerprint": "MAPREDUCE coll a", + "FirstSeen": "2017-10-15T01:54:56.951Z", + "LastSeen": "2017-10-15T01:54:56.951Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 3 + ], + "QueryTime": [ + 26 + ], + "ResponseLength": [ + 218 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_2.6.12 b/src/go/tests/expect/stats_single/update_2.6.12 new file mode 100755 index 00000000..4611f1e0 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_2.6.12 @@ -0,0 +1,27 @@ +[ + { + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", + "Namespace": "test.coll", + "Operation": "UPDATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-10-15T01:54:12.161Z", + "LastSeen": "2017-10-15T01:54:12.161Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.0.15 b/src/go/tests/expect/stats_single/update_3.0.15 new file mode 100755 index 00000000..65af65f5 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.0.15 @@ -0,0 +1,27 @@ +[ + { + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", + "Namespace": "test.coll", + "Operation": "UPDATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-10-15T01:54:21.803Z", + "LastSeen": "2017-10-15T01:54:21.803Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.2.16 b/src/go/tests/expect/stats_single/update_3.2.16 new file mode 100755 index 00000000..f92d8e95 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.2.16 @@ -0,0 +1,27 @@ +[ + { + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", + "Namespace": "test.coll", + "Operation": "UPDATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-10-15T01:54:35.583Z", + "LastSeen": "2017-10-15T01:54:35.583Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 2 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.4.7 b/src/go/tests/expect/stats_single/update_3.4.7 new file mode 100755 index 00000000..1a144d52 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.4.7 @@ -0,0 +1,27 @@ +[ + { + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", + "Namespace": "test.coll", + "Operation": "UPDATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"query\":{\"a\":{\"$gte\":2}},\"updateobj\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-10-15T01:54:46.168Z", + "LastSeen": "2017-10-15T01:54:46.168Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/expect/stats_single/update_3.5.11 b/src/go/tests/expect/stats_single/update_3.5.11 new file mode 100755 index 00000000..43387e92 --- /dev/null +++ b/src/go/tests/expect/stats_single/update_3.5.11 @@ -0,0 +1,27 @@ +[ + { + "ID": "f74a5120ac22d02120ccbf6d478b0dbc", + "Namespace": "test.coll", + "Operation": "UPDATE", + "Query": "{\"ns\":\"test.coll\",\"op\":\"update\",\"command\":{\"q\":{\"a\":{\"$gte\":2}},\"u\":{\"$set\":{\"c\":1},\"$inc\":{\"a\":-10}},\"multi\":false,\"upsert\":false}}\n", + "Fingerprint": "UPDATE coll a", + "FirstSeen": "2017-10-15T01:54:57.231Z", + "LastSeen": "2017-10-15T01:54:57.231Z", + "TableScan": false, + "Count": 1, + "BlockedTime": null, + "LockTime": null, + "NReturned": [ + 0 + ], + "NScanned": [ + 1 + ], + "QueryTime": [ + 0 + ], + "ResponseLength": [ + 0 + ] + } +] \ No newline at end of file diff --git a/src/go/tests/fingerprinter_doc.json b/src/go/tests/fingerprinter_doc.json new file mode 100644 index 00000000..139c6ed7 --- /dev/null +++ b/src/go/tests/fingerprinter_doc.json @@ -0,0 +1,172 @@ +{ + "op": "query", + "ns": "sbtest.sbtest3", + "query": { + "find": "sbtest3", + "filter": { + "$and": [ + { + "k": { + "$gt": -433.7692307692308 + } + }, + { + "k": { + "$lt": 174159.27130926086 + } + }, + { + "$or": [ + { + "c": { + "$in": [ + 0, + 2, + 4, + 6 + ] + } + }, + { + "pad": { + "$in": [ + 9, + 7, + 5, + 3 + ] + } + } + ] + } + ] + }, + "limit": 100, + "singleBatch": false, + "sort": { + "k": -1 + } + }, + "keysExamined": 0, + "docsExamined": 9919, + "hasSortStage": true, + "cursorExhausted": true, + "keyUpdates": 0, + "writeConflicts": 0, + "numYield": 78, + "locks": { + "Global": { + "acquireCount": { + "r": NumberLong(158) + } + }, + "Database": { + "acquireCount": { + "r": NumberLong(79) + } + }, + "Collection": { + "acquireCount": { + "r": NumberLong(79) + } + } + }, + "nreturned": 100, + "responseLength": 22195, + "protocol": "op_command", + "millis": 26, + "execStats": { + "stage": "SORT", + "nReturned": 100, + "executionTimeMillisEstimate": 30, + "works": 10023, + "advanced": 100, + "needTime": 9922, + "needYield": 0, + "saveState": 78, + "restoreState": 78, + "isEOF": 1, + "invalidates": 0, + "sortPattern": { + "k": -1 + }, + "memUsage": 22500, + "memLimit": 33554432, + "limitAmount": 100, + "inputStage": { + "stage": "SORT_KEY_GENERATOR", + "nReturned": 0, + "executionTimeMillisEstimate": 30, + "works": 9922, + "advanced": 0, + "needTime": 9789, + "needYield": 0, + "saveState": 78, + "restoreState": 78, + "isEOF": 1, + "invalidates": 0, + "inputStage": { + "stage": "COLLSCAN", + "filter": { + "$and": [ + { + "$or": [ + { + "c": { + "$in": [ + 0, + 2, + 4, + 6 + ] + } + }, + { + "pad": { + "$in": [ + 9, + 7, + 5, + 3 + ] + } + } + ] + }, + { + "k": { + "$lt": 174159.27130926086 + } + }, + { + "k": { + "$gt": -433.7692307692308 + } + } + ] + }, + "nReturned": 132, + "executionTimeMillisEstimate": 30, + "works": 9921, + "advanced": 132, + "needTime": 9788, + "needYield": 0, + "saveState": 78, + "restoreState": 78, + "isEOF": 1, + "invalidates": 0, + "direction": "forward", + "docsExamined": 9919 + } + } + }, + "ts": ISODate("2017-04-27T16:40:01.029Z"), + "client": "127.0.0.1", + "allUsers": [ + { + "user": "admin", + "db": "admin" + } + ], + "user": "admin@admin" +} \ No newline at end of file diff --git a/src/go/tests/profiler_docs_stats.json b/src/go/tests/profiler_docs_stats.json index 9abff90c..62335a9f 100644 --- a/src/go/tests/profiler_docs_stats.json +++ b/src/go/tests/profiler_docs_stats.json @@ -150,13 +150,13 @@ "Op": "query", "Protocol": "op_command", "Query": { + "find": "col1", "filter": { "s2": { "$gte": "41991", "$lt": "33754" } }, - "find": "col1", "shardVersion": [ 0, "000000000000000000000000" @@ -237,13 +237,13 @@ "Op": "query", "Protocol": "op_command", "Query": { + "find": "col1", "filter": { "user_id": { "$gte": 3384024924, "$lt": 195092007 } }, - "find": "col1", "projection": { "$sortKey": { "$meta": "sortKey" diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index fc203be0..d54aec25 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -1,10 +1,10 @@ [ { - "ID": "c6466139b21c392acd0699e863b50d81", + "ID": "95575e896c2830043dc333cb8ee61339", "Namespace": "samples.col1", - "Operation": "query", - "Query": "{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}", - "Fingerprint": "find", + "Operation": "FIND", + "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", + "Fingerprint": "FIND col1 find", "FirstSeen": "2017-04-10T13:16:23.29-03:00", "LastSeen": "2017-04-10T13:16:23.29-03:00", "Count": 1, @@ -22,7 +22,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 0.9995949739087844, + "Pct": 99.95949739087844, "Total": 1061230, "Min": 1061230, "Max": 1061230, @@ -53,11 +53,11 @@ } }, { - "ID": "84e09ef6a3dc35f472df05fa98eee7d3", + "ID": "d7088d6b50551d1f2f5f34b006c0140d", "Namespace": "samples.col1", - "Operation": "query", - "Query": "{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}}", - "Fingerprint": "s2", + "Operation": "FIND", + "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"s2\":{\"$gte\":\"41991\",\"$lt\":\"33754\"}},\"shardVersion\":[0,\"000000000000000000000000\"]}}\n", + "Fingerprint": "FIND col1 s2", "FirstSeen": "2017-04-10T13:15:53.532-03:00", "LastSeen": "2017-04-10T13:15:53.532-03:00", "Count": 1, @@ -75,7 +75,7 @@ "Median": 7 }, "ResponseLength": { - "Pct": 0.00020251304560782172, + "Pct": 0.020251304560782172, "Total": 215, "Min": 215, "Max": 215, @@ -106,11 +106,11 @@ } }, { - "ID": "69e3b2f5f0aefcec868c0fa5ec8cebe5", + "ID": "b4b7a063b3afbcbdf042a0f0f9e48a9d", "Namespace": "samples.col1", - "Operation": "query", - "Query": "{\"user_id\":{\"$gte\":3384024924,\"$lt\":195092007}}", - "Fingerprint": "user_id", + "Operation": "FIND", + "Query": "{\"ns\":\"samples.col1\",\"op\":\"query\",\"query\":{\"find\":\"col1\",\"filter\":{\"user_id\":{\"$gte\":3.384024924e+09,\"$lt\":1.95092007e+08}},\"projection\":{\"$sortKey\":{\"$meta\":\"sortKey\"}},\"shardVersion\":[0,\"000000000000000000000000\"],\"sort\":{\"user_id\":1}}}\n", + "Fingerprint": "FIND col1 user_id", "FirstSeen": "2017-04-10T13:15:53.524-03:00", "LastSeen": "2017-04-10T13:15:53.524-03:00", "Count": 1, @@ -128,7 +128,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 0.00020251304560782172, + "Pct": 0.020251304560782172, "Total": 215, "Min": 215, "Max": 215, diff --git a/src/go/tests/profiler_docs_total_stats.want.json b/src/go/tests/profiler_docs_total_stats.want.json index 39bc4c5c..e7e0dfc2 100755 --- a/src/go/tests/profiler_docs_total_stats.want.json +++ b/src/go/tests/profiler_docs_total_stats.want.json @@ -2,12 +2,12 @@ "ID": "", "Namespace": "", "Operation": "", - "Query": "null", + "Query": "", "Fingerprint": "", "FirstSeen": "0001-01-01T00:00:00Z", "LastSeen": "0001-01-01T00:00:00Z", - "Count": 0, - "QPS": 0, + "Count": 3, + "QPS": 3, "Rank": 0, "Ratio": 134.33333333333334, "QueryTime": { @@ -21,7 +21,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 1, + "Pct": 100, "Total": 1061660, "Min": 215, "Max": 1061230, diff --git a/t/lib/ExplainAnalyzer.t b/t/lib/ExplainAnalyzer.t index 43484760..86c9638c 100644 --- a/t/lib/ExplainAnalyzer.t +++ b/t/lib/ExplainAnalyzer.t @@ -52,7 +52,7 @@ my $want = [ key_len => 2, ref => 'const', rows => 1, - Extra => $sandbox_version gt '5.6' ? undef : '', + Extra => $sandbox_version eq '5.6' ? undef : '', }, ]; if ( $sandbox_version gt '5.6' ) { diff --git a/t/lib/JSONReportFormatter.t b/t/lib/JSONReportFormatter.t index fae98352..2e3ad3bf 100644 --- a/t/lib/JSONReportFormatter.t +++ b/t/lib/JSONReportFormatter.t @@ -12,6 +12,8 @@ use strict; use warnings FATAL => 'all'; use English qw(-no_match_vars); use Test::More; +use JSON; +use File::Slurp; use Data::Dumper; $Data::Dumper::Indent = 1; @@ -155,14 +157,27 @@ $result = $j->query_report( groupby => 'fingerprint', ); -ok( - no_diff( - $result, - "t/lib/samples/JSONReportFormatter/report001.json", - cmd_output => 1, - ), - 'Basic output' -) or diag($test_diff); +my $sample_file = "t/lib/samples/JSONReportFormatter/report001.json"; +my $want_text = read_file($sample_file); +my $want = decode_json $want_text; +my $got = decode_json $result; + + +# I've change the original test because it was comparing JSONs as strings +# but it is hard (or impossible) to ensure in all environments the output +# will have a particular order. +# I prefer to decode_json($result) and compare it against the struct I am +# expecting as a result for 2 reasons: +# 1) using decode_json ensures that the json syntax is valid, but comparing +# strings cannot ensure that since the sample json may contain syntax errors. +# 2) Using structs (hashes) and is_deeply makes this test to work regarding +# of the sort order during the encoding process. + +is_deeply( + $got, + $want, + 'Basic output', +); # ############################################################################# # Done. diff --git a/t/lib/TableParser.t b/t/lib/TableParser.t index 52bdd52b..91137219 100644 --- a/t/lib/TableParser.t +++ b/t/lib/TableParser.t @@ -11,6 +11,7 @@ use warnings FATAL => 'all'; use English qw(-no_match_vars); use Test::More; +use Text::Diff; use TableParser; use Quoter; use DSNParser; @@ -71,21 +72,23 @@ like($EVAL_ERROR, qr/quoting/, 'No quoting'); $tbl = $tp->parse( load_file('t/lib/samples/t1.sql') ); is_deeply( $tbl, - { cols => [qw(a)], - col_posn => { a => 0 }, - is_col => { a => 1 }, - is_autoinc => { a => 0 }, - null_cols => [qw(a)], - is_nullable => { a => 1 }, - clustered_key => undef, - keys => {}, - defs => { a => ' `a` int(11) default NULL' }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int' }, - name => 't1', - charset => 'latin1', + { cols => [qw(a)], + col_posn => { a => 0 }, + is_col => { a => 1 }, + is_autoinc => { a => 0 }, + null_cols => [qw(a)], + is_generated => {}, + non_generated_cols => [ 'a' ], + is_nullable => { a => 1 }, + clustered_key => undef, + keys => {}, + defs => { a => ' `a` int(11) default NULL' }, + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + engine => 'MyISAM', + type_for => { a => 'int' }, + name => 't1', + charset => 'latin1', }, 'Basic table is OK', ); @@ -94,11 +97,13 @@ $tbl = $tp->parse( load_file('t/lib/samples/TableParser-prefix_idx.sql') ); is_deeply( $tbl, { - name => 't1', - cols => [ 'a', 'b' ], - col_posn => { a => 0, b => 1 }, - is_col => { a => 1, b => 1 }, - is_autoinc => { 'a' => 0, 'b' => 0 }, + name => 't1', + cols => [ 'a', 'b' ], + non_generated_cols => [ 'a', 'b' ], + col_posn => { a => 0, b => 1 }, + is_col => { a => 1, b => 1 }, + is_autoinc => { 'a' => 0, 'b' => 0 }, + is_generated => {}, null_cols => [ 'a', 'b' ], is_nullable => { 'a' => 1, 'b' => 1 }, clustered_key => undef, @@ -169,6 +174,12 @@ is_deeply( length replacement_cost rating special_features last_update) ], + non_generated_cols => [ + qw(film_id title description release_year language_id + original_language_id rental_duration rental_rate + length replacement_cost rating special_features + last_update) + ], col_posn => { film_id => 0, title => 1, @@ -214,6 +225,7 @@ is_deeply( special_features => 1, last_update => 1, }, + is_generated => {}, null_cols => [qw(description release_year original_language_id length rating special_features )], is_nullable => { description => 1, @@ -342,25 +354,109 @@ throws_ok ( $tbl = $tp->parse( load_file('t/lib/samples/temporary_table.sql') ); is_deeply( $tbl, - { cols => [qw(a)], - col_posn => { a => 0 }, - is_col => { a => 1 }, - is_autoinc => { a => 0 }, - null_cols => [qw(a)], - is_nullable => { a => 1 }, - clustered_key => undef, - keys => {}, - defs => { a => ' `a` int(11) default NULL' }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int' }, - name => 't', - charset => 'latin1', + { cols => [qw(a)], + non_generated_cols => [qw(a)], + col_posn => { a => 0 }, + is_col => { a => 1 }, + is_autoinc => { a => 0 }, + is_generated => {}, + null_cols => [qw(a)], + is_nullable => { a => 1 }, + clustered_key => undef, + keys => {}, + defs => { a => ' `a` int(11) default NULL' }, + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + engine => 'MyISAM', + type_for => { a => 'int' }, + name => 't', + charset => 'latin1', }, 'Temporary table', ); +my $want = { 'is_autoinc' => { + 'sort_order' => 0, + 'pfk-source_instrument_id' => 0, + 'pfk-related_instrument_id' => 0 + }, + 'null_cols' => [], + 'numeric_cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + 'cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + 'non_generated_cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + is_autogenerated => {}, + 'col_posn' => { + 'sort_order' => 2, + 'pfk-source_instrument_id' => 0, + 'pfk-related_instrument_id' => 1 + }, + clustered_key => 'PRIMARY', + 'keys' => { + 'sort_order' => { + 'is_unique' => 0, + 'is_col' => { 'sort_order' => 1 }, + 'name' => 'sort_order', + 'type' => 'BTREE', + 'col_prefixes' => [ undef ], + 'is_nullable' => 0, + 'colnames' => '`sort_order`', + 'cols' => [ 'sort_order' ], + ddl => 'KEY `sort_order` (`sort_order`)', + }, + 'PRIMARY' => { + 'is_unique' => 1, + 'is_col' => { + 'pfk-source_instrument_id' => 1, + 'pfk-related_instrument_id' => 1 + }, + 'name' => 'PRIMARY', + 'type' => 'BTREE', + 'col_prefixes' => [ undef, undef ], + 'is_nullable' => 0, + 'colnames' => + '`pfk-source_instrument_id`,`pfk-related_instrument_id`', + 'cols' => + [ 'pfk-source_instrument_id', 'pfk-related_instrument_id' ], + ddl => 'PRIMARY KEY (`pfk-source_instrument_id`,`pfk-related_instrument_id`),', + } + }, + 'defs' => { + 'sort_order' => ' `sort_order` int(11) NOT NULL', + 'pfk-source_instrument_id' => + ' `pfk-source_instrument_id` int(10) unsigned NOT NULL', + 'pfk-related_instrument_id' => + ' `pfk-related_instrument_id` int(10) unsigned NOT NULL' + }, + 'engine' => 'InnoDB', + 'is_col' => { + 'sort_order' => 1, + 'pfk-source_instrument_id' => 1, + 'pfk-related_instrument_id' => 1 + }, + 'is_numeric' => { + 'sort_order' => 1, + 'pfk-source_instrument_id' => 1, + 'pfk-related_instrument_id' => 1 + }, + 'type_for' => { + 'sort_order' => 'int', + 'pfk-source_instrument_id' => 'int', + 'pfk-related_instrument_id' => 'int' + }, + 'is_nullable' => {}, + name => 'instrument_relation', + charset => 'latin1', + }; + $tbl = $tp->parse( load_file('t/lib/samples/hyphentest.sql') ); is_deeply( $tbl, @@ -378,6 +474,11 @@ is_deeply( 'pfk-source_instrument_id', 'pfk-related_instrument_id', 'sort_order' ], + 'non_generated_cols' => [ + 'pfk-source_instrument_id', 'pfk-related_instrument_id', + 'sort_order' + ], + is_generated => {}, 'col_posn' => { 'sort_order' => 2, 'pfk-source_instrument_id' => 0, @@ -446,13 +547,14 @@ is_deeply( $tbl = $tp->parse( load_file('t/lib/samples/ndb_table.sql') ); is_deeply( $tbl, - { cols => [qw(id)], - col_posn => { id => 0 }, - is_col => { id => 1 }, - is_autoinc => { id => 1 }, - null_cols => [], - is_nullable => {}, - clustered_key => undef, + { cols => [qw(id)], + non_generated_cols => [qw(id)], + col_posn => { id => 0 }, + is_col => { id => 1 }, + is_autoinc => { id => 1 }, + null_cols => [], + is_nullable => {}, + clustered_key => undef, keys => { PRIMARY => { cols => [qw(id)], @@ -473,6 +575,7 @@ is_deeply( type_for => { id => 'bigint' }, name => 'pipo', charset => 'latin1', + is_generated => {}, }, 'NDB table', ); @@ -481,9 +584,11 @@ $tbl = $tp->parse( load_file('t/lib/samples/mixed-case.sql') ); is_deeply( $tbl, { cols => [qw(a b mixedcol)], + non_generated_cols => [qw(a b mixedcol)], col_posn => { a => 0, b => 1, mixedcol => 2 }, is_col => { a => 1, b => 1, mixedcol => 1 }, is_autoinc => { a => 0, b => 0, mixedcol => 0 }, + is_generated => {}, null_cols => [qw(a b mixedcol)], is_nullable => { a => 1, b => 1, mixedcol => 1 }, clustered_key => undef, @@ -518,14 +623,15 @@ is_deeply( $tbl = $tp->parse( load_file('t/lib/samples/one_key.sql') ); is_deeply( $tbl, - { cols => [qw(a b)], - col_posn => { a => 0, b => 1 }, - is_col => { a => 1, b => 1 }, - is_autoinc => { a => 0, b => 0 }, - null_cols => [qw(b)], - is_nullable => { b => 1 }, - clustered_key => undef, - keys => { + { cols => [qw(a b)], + non_generated_cols => [qw(a b)], + col_posn => { a => 0, b => 1 }, + is_col => { a => 1, b => 1 }, + is_autoinc => { a => 0, b => 0 }, + null_cols => [qw(b)], + is_nullable => { b => 1 }, + clustered_key => undef, + keys => { PRIMARY => { colnames => '`a`', cols => [qw(a)], @@ -538,16 +644,17 @@ is_deeply( ddl => 'PRIMARY KEY (`a`)', }, }, - defs => { + defs => { a => ' `a` int(11) NOT NULL', b => ' `b` char(50) default NULL', }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int', b => 'char' }, - name => 't2', - charset => 'latin1', + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + is_generated => {}, + engine => 'MyISAM', + type_for => { a => 'int', b => 'char' }, + name => 't2', + charset => 'latin1', }, 'No clustered key on MyISAM table' ); @@ -751,21 +858,23 @@ cmp_ddls('v5.0 vs. v5.1', 't/lib/samples/issue_109-01-v50.sql', 't/lib/samples/i $tbl = $tp->parse( load_file('t/lib/samples/issue_132.sql') ); is_deeply( $tbl, - { cols => [qw(country)], - col_posn => { country => 0 }, - is_col => { country => 1 }, - is_autoinc => { country => 0 }, - null_cols => [qw(country)], - is_nullable => { country => 1 }, - clustered_key => undef, - keys => {}, - defs => { country => " `country` enum('','Cote D`ivoire') default NULL"}, - numeric_cols => [], - is_numeric => {}, - engine => 'MyISAM', - type_for => { country => 'enum' }, - name => 'issue_132', - charset => 'latin1', + { cols => [qw(country)], + non_generated_cols => [qw(country)], + col_posn => { country => 0 }, + is_col => { country => 1 }, + is_autoinc => { country => 0 }, + is_generated => {}, + null_cols => [qw(country)], + is_nullable => { country => 1 }, + clustered_key => undef, + keys => {}, + defs => { country => " `country` enum('','Cote D`ivoire') default NULL"}, + numeric_cols => [], + is_numeric => {}, + engine => 'MyISAM', + type_for => { country => 'enum' }, + name => 'issue_132', + charset => 'latin1', }, 'ENUM col with backtick in value (issue 132)' ); @@ -787,21 +896,51 @@ is( $tbl = $tp->parse( load_file('t/lib/samples/issue_330_backtick_pair_in_col_comments.sql') ); is_deeply( $tbl, - { cols => [qw(a)], - col_posn => { a => 0 }, - is_col => { a => 1 }, - is_autoinc => { a => 0 }, - null_cols => [qw(a)], - is_nullable => { a => 1 }, - clustered_key => undef, - keys => {}, - defs => { a => " `a` int(11) DEFAULT NULL COMMENT 'issue_330 `alex`'" }, - numeric_cols => [qw(a)], - is_numeric => { a => 1 }, - engine => 'MyISAM', - type_for => { a => 'int' }, - name => 'issue_330', - charset => 'latin1', + { cols => [qw(a)], + non_generated_cols => [qw(a)], + col_posn => { a => 0 }, + is_col => { a => 1 }, + is_generated => {}, + is_autoinc => { a => 0 }, + null_cols => [qw(a)], + is_nullable => { a => 1 }, + clustered_key => undef, + keys => {}, + defs => { a => " `a` int(11) DEFAULT NULL COMMENT 'issue_330 `alex`'" }, + numeric_cols => [qw(a)], + is_numeric => { a => 1 }, + engine => 'MyISAM', + type_for => { a => 'int' }, + name => 'issue_330', + charset => 'latin1', + }, + 'issue with pairing backticks in column comments (issue 330)' +); + + +$tbl = $tp->parse( load_file('t/lib/samples/issue_pt-193_backtick_in_col_comments.sql') ); +is_deeply( + $tbl, + { cols => [qw(id f22abcde f23abc)], + non_generated_cols => [qw(id f22abcde f23abc)], + col_posn => { id => 0, f22abcde => 1, f23abc => 2 }, + is_col => { id => 1, f22abcde => 1, f23abc => 1 }, + is_autoinc => { id => 1, f22abcde => 0, f23abc => 0 }, + is_generated => {}, + null_cols => [qw(f22abcde)], + is_nullable => { f22abcde => 1}, + clustered_key => undef, + keys => {}, + defs => { id => " `id` int(11) NOT NULL AUTO_INCREMENT", + "f22abcde" => " `f22abcde` int(10) unsigned DEFAULT NULL COMMENT 'xxx`XXx'", + "f23abc" => " `f23abc` int(10) unsigned NOT NULL DEFAULT '255' COMMENT \"`yyy\"" + }, + numeric_cols => [qw(id f22abcde f23abc)], + is_numeric => { id => 1, f22abcde => 1, f23abc => 1 }, + engine => 'InnoDB', + type_for => { id => 'int', f22abcde => 'int', f23abc => 'int' }, + name => 't3', + charset => 'latin1', }, 'issue with pairing backticks in column comments (issue 330)' ); @@ -848,12 +987,14 @@ is_deeply( clustered_key => undef, col_posn => { 'first, last' => 1, id => 0 }, cols => [ 'id', 'first, last' ], + non_generated_cols => [ 'id', 'first, last' ], defs => { 'first, last' => ' `first, last` varchar(32) default NULL', id => ' `id` int(11) NOT NULL auto_increment', }, engine => 'MyISAM', is_autoinc => { 'first, last' => 0, id => 1 }, + is_generated => {}, is_col => { 'first, last' => 1, id => 1 }, is_nullable => { 'first, last' => 1 }, is_numeric => { id => 1 }, @@ -974,22 +1115,24 @@ $tbl = $tp->parse(load_file('t/lib/samples/triple-quoted-col.sql')); is_deeply( $tbl, { - clustered_key => undef, - col_posn => { 'foo' => 0, bar => 1 }, - cols => [ 'foo', 'bar' ], - defs => { + clustered_key => undef, + col_posn => { 'foo' => 0, bar => 1 }, + is_generated => {}, + cols => [ 'foo', 'bar' ], + non_generated_cols => [ 'foo', 'bar' ], + defs => { 'foo' => ' `foo` int(11) DEFAULT NULL', 'bar' => ' ```bar``` int(11) DEFAULT NULL', }, - engine => 'InnoDB', - is_autoinc => { foo => 0, bar => 0 }, - is_col => { foo => 1, bar => 1 }, - is_nullable => { foo => 1, bar => 1 }, - is_numeric => { foo => 1, bar => 1 }, - name => 't', - null_cols => [ 'foo', 'bar' ], - numeric_cols => [ 'foo', 'bar' ], - type_for => { + engine => 'InnoDB', + is_autoinc => { foo => 0, bar => 0 }, + is_col => { foo => 1, bar => 1 }, + is_nullable => { foo => 1, bar => 1 }, + is_numeric => { foo => 1, bar => 1 }, + name => 't', + null_cols => [ 'foo', 'bar' ], + numeric_cols => [ 'foo', 'bar' ], + type_for => { foo => 'int', bar => 'int', }, @@ -999,6 +1142,51 @@ is_deeply( 'Literal backticks (bug 1462904)' ); +SKIP: { + skip "generated column tests require MySQL 5.7+", 1 + if $sandbox_version lt '5.7'; + $tbl = $tp->parse( load_file('t/lib/samples/generated_cols.sql') ); + is_deeply( + $tbl, + { + charset => 'utf8mb4', + clustered_key => 'PRIMARY', + col_posn => { column2 => 1, column3 => 2, id => 0 }, + cols => [ 'id', 'column2', 'column3' ], + non_generated_cols => [ 'id', 'column2' ], + defs => { + column2 => ' `column2` int(11) DEFAULT NULL', + column3 => ' `column3` int(11) GENERATED ALWAYS AS ((`column2` + 1)) STORED', + id => ' `id` int(11) NOT NULL' + }, + engine => 'InnoDB', + is_autoinc => { column2 => 0, column3 => 0, id => 0 }, + is_col => { column2 => 1, column3 => 1, id => 1 }, + is_generated => { column3 => 1 }, + is_nullable => { column2 => 1, column3 => 1 }, + is_numeric => { column2 => 1, column3 => 1, id => 1 }, + keys => { + PRIMARY => { + col_prefixes => [ undef ], + colnames => '`id`', + cols => [ 'id' ], + ddl => 'PRIMARY KEY (`id`)', + is_col => { id => 1 }, + is_nullable => 0, + is_unique => 1, + name => 'PRIMARY', + type => 'BTREE' + } + }, + name => 't1', + null_cols => [ 'column2', 'column3' ], + numeric_cols => [ 'id', 'column2', 'column3' ], + type_for => { column2 => 'int', column3 => 'int', id => 'int' } + }, + 'Generated columns is OK', + ) or die Data::Dumper::Dumper($tbl); +} + # ############################################################################# # Done. # ############################################################################# diff --git a/t/lib/samples/JSONReportFormatter/report001.json b/t/lib/samples/JSONReportFormatter/report001.json index 03b771a4..465c2de9 100644 --- a/t/lib/samples/JSONReportFormatter/report001.json +++ b/t/lib/samples/JSONReportFormatter/report001.json @@ -1 +1 @@ -{"classes":[{"attribute":"fingerprint","checksum":"82860EDA9A88FCC5","distillate":"SELECT users","example":{"Query_time":"8.000652","query":"SELECT id FROM users WHERE name='foo'","ts":"2007-10-15 21:43:52"},"fingerprint":"select id from users where name=?","histograms":{"Query_time":[0,0,0,0,0,0,2,0]},"metrics":{"Lock_time":{"avg":"0.000155","max":"0.000201","median":"0.000155","min":"0.000109","pct":"0.666667","pct_95":"0.000201","stddev":"0.000065","sum":"0.000310"},"Query_time":{"avg":"4.500667","max":"8.000652","median":"4.500667","min":"1.000682","pct":"0.666667","pct_95":"8.000652","stddev":"4.949726","sum":"9.001334"},"Rows_examined":{"avg":"1","max":"2","median":"1","min":"1","pct":"0","pct_95":"2","stddev":"0","sum":"3"},"Rows_sent":{"avg":"1","max":"1","median":"1","min":"1","pct":"0","pct_95":"1","stddev":"0","sum":"2"},"db":{"value":"test3"},"user":{"value":"root"}},"query_count":null,"tables":[{"create":"SHOW CREATE TABLE `test3`.`users`\\G","status":"SHOW TABLE STATUS FROM `test3` LIKE 'users'\\G"}],"ts_max":"2007-10-15 21:43:53","ts_min":"2007-10-15 21:43:52"},{"attribute":"fingerprint","checksum":"1087A32FED3B7EBB","distillate":"INSERT articles","example":{"Query_time":"1.001943","query":"INSERT IGNORE INTO articles (id, body,)VALUES(3558268,'sample text')","ts":"2007-10-15 21:43:52"},"fingerprint":"insert ignore into articles (id, body,)values(?+)","histograms":{"Query_time":[0,0,0,0,0,0,1,0]},"metrics":{"Lock_time":{"avg":"0.000145","max":"0.000145","median":"0.000145","min":"0.000145","pct":"0.333333","pct_95":"0.000145","stddev":"0.000000","sum":"0.000145"},"Query_time":{"avg":"1.001943","max":"1.001943","median":"1.001943","min":"1.001943","pct":"0.333333","pct_95":"1.001943","stddev":"0.000000","sum":"1.001943"},"Rows_examined":{"avg":"0","max":"0","median":"0","min":"0","pct":"0","pct_95":"0","stddev":"0","sum":"0"},"Rows_sent":{"avg":"0","max":"0","median":"0","min":"0","pct":"0","pct_95":"0","stddev":"0","sum":"0"},"db":{"value":"test1"},"user":{"value":"root"}},"query_count":null,"tables":[{"create":"SHOW CREATE TABLE `test1`.`articles`\\G","status":"SHOW TABLE STATUS FROM `test1` LIKE 'articles'\\G"}],"ts_max":"2007-10-15 21:43:52","ts_min":"2007-10-15 21:43:52"}],"global":{"files":null,"metrics":{"Lock_time":{"avg":"0.000152","max":"0.000201","median":"0.000145","min":"0.000109","pct_95":"0.000194","stddev":"0.000035","sum":"0.000455"},"Query_time":{"avg":"3.334426","max":"8.000652","median":"0.992137","min":"1.000682","pct_95":"7.700558","stddev":"3.162380","sum":"10.003277"},"Rows_examined":{"avg":"1","max":"2","median":"0","min":"0","pct_95":"1","stddev":"0","sum":"3"},"Rows_sent":{"avg":"0","max":"1","median":"0","min":"0","pct_95":"0","stddev":"0","sum":"2"}},"query_count":3,"unique_query_count":2}} +{"classes":[{"ts_max":"2007-10-15 21:43:53","checksum":"82860EDA9A88FCC5","distillate":"SELECT users","ts_min":"2007-10-15 21:43:52","example":{"ts":"2007-10-15 21:43:52","query":"SELECT id FROM users WHERE name='foo'","Query_time":"8.000652"},"query_count":null,"attribute":"fingerprint","metrics":{"Lock_time":{"avg":"0.000155","sum":"0.000310","median":"0.000155","pct":"0.666667","max":"0.000201","pct_95":"0.000201","min":"0.000109","stddev":"0.000065"},"Rows_examined":{"min":"1","stddev":"0","pct_95":"2","max":"2","median":"1","pct":"0","avg":"1","sum":"3"},"user":{"value":"root"},"Query_time":{"median":"4.500667","pct":"0.666667","avg":"4.500667","sum":"9.001334","min":"1.000682","stddev":"4.949726","pct_95":"8.000652","max":"8.000652"},"Rows_sent":{"pct_95":"1","max":"1","min":"1","stddev":"0","sum":"2","avg":"1","pct":"0","median":"1"},"db":{"value":"test3"}},"tables":[{"create":"SHOW CREATE TABLE `test3`.`users`\\G","status":"SHOW TABLE STATUS FROM `test3` LIKE 'users'\\G"}],"fingerprint":"select id from users where name=?","histograms":{"Query_time":[0,0,0,0,0,0,2,0]}},{"ts_max":"2007-10-15 21:43:52","checksum":"1087A32FED3B7EBB","distillate":"INSERT articles","ts_min":"2007-10-15 21:43:52","example":{"ts":"2007-10-15 21:43:52","query":"INSERT IGNORE INTO articles (id, body,)VALUES(3558268,'sample text')","Query_time":"1.001943"},"query_count":null,"attribute":"fingerprint","metrics":{"db":{"value":"test1"},"Rows_sent":{"min":"0","stddev":"0","pct_95":"0","max":"0","median":"0","pct":"0","avg":"0","sum":"0"},"Query_time":{"min":"1.001943","stddev":"0.000000","pct_95":"1.001943","max":"1.001943","pct":"0.333333","median":"1.001943","sum":"1.001943","avg":"1.001943"},"user":{"value":"root"},"Rows_examined":{"median":"0","pct":"0","avg":"0","sum":"0","min":"0","stddev":"0","pct_95":"0","max":"0"},"Lock_time":{"pct":"0.333333","median":"0.000145","sum":"0.000145","avg":"0.000145","min":"0.000145","stddev":"0.000000","pct_95":"0.000145","max":"0.000145"}},"tables":[{"status":"SHOW TABLE STATUS FROM `test1` LIKE 'articles'\\G","create":"SHOW CREATE TABLE `test1`.`articles`\\G"}],"fingerprint":"insert ignore into articles (id, body,)values(?+)","histograms":{"Query_time":[0,0,0,0,0,0,1,0]}}],"global":{"files":null,"query_count":3,"metrics":{"Query_time":{"min":"1.000682","median":"0.992137","stddev":"3.162380","max":"8.000652","pct_95":"7.700558","sum":"10.003277","avg":"3.334426"},"Rows_sent":{"stddev":"0","median":"0","min":"0","sum":"2","max":"1","pct_95":"0","avg":"0"},"Rows_examined":{"avg":"1","pct_95":"1","max":"2","sum":"3","median":"0","min":"0","stddev":"0"},"Lock_time":{"stddev":"0.000035","min":"0.000109","median":"0.000145","avg":"0.000152","sum":"0.000455","pct_95":"0.000194","max":"0.000201"}},"unique_query_count":2}} diff --git a/t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt b/t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt index acc7329f..3772256a 100644 --- a/t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt +++ b/t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt @@ -126,6 +126,38 @@ CREATE TABLE `ndb_binlog_index` ( PRIMARY KEY (`epoch`,`orig_server_id`,`orig_epoch`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 +mysql.plugin +CREATE TABLE `plugin` ( + `name` varchar(64) NOT NULL DEFAULT '', + `dl` varchar(128) NOT NULL DEFAULT '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins' + +mysql.proc +CREATE TABLE `proc` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `type` enum('FUNCTION','PROCEDURE') NOT NULL, + `specific_name` char(64) NOT NULL DEFAULT '', + `language` enum('SQL') NOT NULL DEFAULT 'SQL', + `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', + `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', + `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', + `param_list` blob NOT NULL, + `returns` longblob NOT NULL, + `body` longblob NOT NULL, + `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' + mysql.procs_priv CREATE TABLE `procs_priv` ( `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', diff --git a/t/lib/samples/SchemaIterator/all-dbs.txt b/t/lib/samples/SchemaIterator/all-dbs.txt index d2e98c84..1437ae5b 100644 --- a/t/lib/samples/SchemaIterator/all-dbs.txt +++ b/t/lib/samples/SchemaIterator/all-dbs.txt @@ -148,6 +148,38 @@ CREATE TABLE `ndb_binlog_index` ( PRIMARY KEY (`epoch`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +mysql.plugin +CREATE TABLE `plugin` ( + `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', + `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins'; + +mysql.proc +CREATE TABLE `proc` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `type` enum('FUNCTION','PROCEDURE') NOT NULL, + `specific_name` char(64) NOT NULL DEFAULT '', + `language` enum('SQL') NOT NULL DEFAULT 'SQL', + `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', + `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', + `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', + `param_list` blob NOT NULL, + `returns` longblob NOT NULL, + `body` longblob NOT NULL, + `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', + `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob, + PRIMARY KEY (`db`,`name`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'; + mysql.procs_priv CREATE TABLE `procs_priv` ( `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', diff --git a/t/lib/samples/generated_cols.sql b/t/lib/samples/generated_cols.sql new file mode 100644 index 00000000..d51e964b --- /dev/null +++ b/t/lib/samples/generated_cols.sql @@ -0,0 +1,6 @@ +CREATE TABLE `t1` ( + `ID` int(11) NOT NULL, + `Column2` int(11) DEFAULT NULL, + `Column3` int(11) GENERATED ALWAYS AS ((`Column2` + 1)) STORED, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci diff --git a/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql b/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql new file mode 100644 index 00000000..6f37b92c --- /dev/null +++ b/t/lib/samples/issue_pt-193_backtick_in_col_comments.sql @@ -0,0 +1,11 @@ +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; +USE test; + +CREATE TABLE `t3` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `f22aBcDe` int(10) unsigned DEFAULT NULL COMMENT 'xxx`XXx', + `f23aBc` int(10) unsigned NOT NULL DEFAULT '255' COMMENT "`yyy", + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; + diff --git a/t/pt-archiver/basics.t b/t/pt-archiver/basics.t index ebcca2b8..a76ee820 100644 --- a/t/pt-archiver/basics.t +++ b/t/pt-archiver/basics.t @@ -161,7 +161,7 @@ $output = output( my $t = time - $t0; ok( - $t >= 2 && $t <= ($ENV{PERCONA_SLOW_BOX} ? 8 : 3), + $t >= 2 && $t <= ($ENV{PERCONA_SLOW_BOX} ? 8 : 4), "--sleep between SELECT (bug 979092)" ) or diag($output, "t=", $t); diff --git a/t/pt-archiver/file.t b/t/pt-archiver/file.t index 121ca890..310ed476 100644 --- a/t/pt-archiver/file.t +++ b/t/pt-archiver/file.t @@ -115,6 +115,25 @@ like( "..but an unknown charset fails" ); +local $SIG{__WARN__} = undef; + +$sb->load_file('master', 't/pt-archiver/samples/table2.sql'); +`rm -f archive.test.table_2`; +$output = output( + sub { pt_archiver::main(qw(--where 1=1 --output-format=csv), "--source", "D=test,t=table_2,F=$cnf", "--file", 'archive.%D.%t') }, +); +$output = `cat archive.test.table_2`; +is($output, < 'all'; +use English qw(-no_match_vars); +use Test::More; + +use PerconaTest; +use Sandbox; +require "$trunk/bin/pt-archiver"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('master'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +else { + plan tests => 3; +} + +my $output; + +# ############################################################################# +# Issue 1152: mk-archiver columns option resulting in null archived table data +# ############################################################################# +$sb->load_file('master', 't/pt-archiver/samples/pt-143.sql'); + +my $original_rows = $dbh->selectall_arrayref('select * from test.stats_r'); +my $exit_status; + +$output = output( + sub { $exit_status = pt_archiver::main( + '--source', 'h=127.1,P=12345,D=test,t=stats_r,u=msandbox,p=msandbox', + '--dest', 'D=test,t=stats_s', + qw(--where 1=1 --purge)) + }, +); + +is ( + $exit_status, + 0, + "PT-143 exit status OK", +); + +my $archived_rows = $dbh->selectall_arrayref('select * from test.stats_s'); + +is_deeply( + $original_rows, + $archived_rows, + "PT-143 Archived rows match original rows" +); + +$dbh->do('DROP DATABASE test'); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +exit; diff --git a/t/pt-archiver/samples/pt-143.sql b/t/pt-archiver/samples/pt-143.sql new file mode 100644 index 00000000..a8246789 --- /dev/null +++ b/t/pt-archiver/samples/pt-143.sql @@ -0,0 +1,33 @@ +DROP SCHEMA IF EXISTS test; +CREATE SCHEMA test; + +CREATE TABLE test.`stats_r` ( +`id` int(10) unsigned NOT NULL, +`end` datetime NOT NULL, +`start` datetime NOT NULL, +`sum_value` float DEFAULT NULL, +`user_id` varchar(100) NOT NULL DEFAULT '', +`interval` int(10) unsigned NOT NULL DEFAULT '0', +`mean` float DEFAULT NULL, +`max` float DEFAULT NULL, +`min` float DEFAULT NULL, +PRIMARY KEY (`id`,`start`,`end`,`user_id`(13),`interval`), +KEY `cid_start_end` (`user_id`(13),`start`,`end`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE test.stats_s LIKE test.stats_r; + +INSERT INTO `test`.`stats_r` +(`id`,`end`,`start`,`sum_value`,`user_id`,`interval`,`mean`,`max`,`min`) +VALUES +(1,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(2,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(3,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(4,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(5,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(6,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(7,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(8,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(9,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1), +(10,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1); + diff --git a/t/pt-archiver/samples/table2.sql b/t/pt-archiver/samples/table2.sql new file mode 100644 index 00000000..4f51b21f --- /dev/null +++ b/t/pt-archiver/samples/table2.sql @@ -0,0 +1,19 @@ +CREATE SCHEMA IF NOT EXISTS test; +use test; +drop table if exists table_2; + +create table table_2( + a int not null primary key, + b int, + c int not null, + d varchar(50), + key(b) +) engine=innodb; + +insert into table_2 values + (1, 2, 3, 4), + (2, null, 3, 4), + (3, 2, 3, "\t"), + (4, 2, 3, "\n"), + (5, 2, 3, "Zapp \"Brannigan"); + diff --git a/t/pt-kill/pt_167.t b/t/pt-kill/pt_167.t new file mode 100644 index 00000000..a133cd25 --- /dev/null +++ b/t/pt-kill/pt_167.t @@ -0,0 +1,98 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Time::HiRes qw(sleep); +use Test::More; +use threads; + +use PerconaTest; +use Sandbox; +require "$trunk/bin/pt-kill"; + +use Data::Dumper; +$Data::Dumper::Indent = 1; +$Data::Dumper::Sortkeys = 1; +$Data::Dumper::Quotekeys = 0; + + +my $o = new OptionParser(description => 'Diskstats', + file => "$trunk/bin/pt-kill", +); +$o->get_specs("$trunk/bin/pt-table-checksum"); +$o->get_opts(); + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('master'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +$sb->load_file('master', "t/pt-kill/samples/pt_167.sql"); +my $ps = $dbh->prepare('INSERT INTO test.foo VALUES (?)'); +for (my $i=0; $i < 20000; $i++) { + $ps->execute($i); +} + +sub start_thread { + my ($dp, $o, $dsn, $sleep_time) = @_; + + diag("Thread started"); + + my $cxn = new Cxn(DSNParser => $dp, OptionParser => $o, dsn => $dsn); + $cxn->connect(); + my $dbh = $cxn->dbh(); + my $sth = $dbh->prepare('SELECT COUNT(*) FROM (SELECT a.id AS a_id, b.id AS b_id FROM foo AS a, foo AS b) AS c'); + # Since this query is going to be killed, wrap the execution in an eval to prevent + # displaying the error message. + eval { + $sth->execute(); + }; +} + +my $dsn = "h=127.1,P=12345,u=msandbox,p=msandbox,D=test;mysql_server_prepare=1"; +my $thr = threads->create('start_thread', $dp, $o, $dp->parse($dsn), 1); +$thr->detach(); +threads->yield(); + +sleep(1); + +my $rows = $dbh->selectall_hashref('show processlist', 'id'); +my $pid = 0; # reuse, reset +map { $pid = $_->{id} } +grep { $_->{info} && $_->{info} =~ m/SELECT COUNT\(\*\) FROM \(SELECT a.id/ } +values %$rows; + +ok( + $pid, + "Got proc id of sleeping query: $pid" +); + +$dsn = $sb->dsn_for('master'); +my $output = output( + sub { pt_kill::main($dsn, "--kill-busy-commands","Query,Execute", qw(--run-time 3s --kill --busy-time 2s --print --match-info), "^(select|SELECT)"), }, + stderr => 1, +); + +like( + $output, + qr/KILL $pid \(Execute/, + '--kill-query' +) or diag($output); + + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-kill/samples/pt_167.sql b/t/pt-kill/samples/pt_167.sql new file mode 100644 index 00000000..0b15466e --- /dev/null +++ b/t/pt-kill/samples/pt_167.sql @@ -0,0 +1,4 @@ +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; + +create table test.foo (id integer); diff --git a/t/pt-online-schema-change/basics.t b/t/pt-online-schema-change/basics.t new file mode 100644 index 00000000..12f1c252 --- /dev/null +++ b/t/pt-online-schema-change/basics.t @@ -0,0 +1,866 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; +use Time::HiRes qw(sleep); + +$ENV{PTTEST_FAKE_TS} = 1; +$ENV{PERCONA_TOOLKIT_TEST_USE_DSN_NAMES} = 1; + +use PerconaTest; +use Sandbox; +require "$trunk/bin/pt-online-schema-change"; +require VersionParser; + +use Data::Dumper; +$Data::Dumper::Indent = 1; +$Data::Dumper::Sortkeys = 1; +$Data::Dumper::Quotekeys = 0; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $slave_dbh = $sb->get_dbh_for('slave1'); + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +elsif ( !$slave_dbh ) { + plan skip_all => 'Cannot connect to sandbox slave'; +} + +my $q = new Quoter(); +my $tp = new TableParser(Quoter => $q); +my @args = qw(--set-vars innodb_lock_wait_timeout=3); +my $output = ""; +my $dsn = "h=127.1,P=12345,u=msandbox,p=msandbox"; +my $exit = 0; +my $sample = "t/pt-online-schema-change/samples"; +my $rows; + +# ############################################################################# +# Tool shouldn't run without --execute (bug 933232). +# ############################################################################# + + +$sb->load_file('master', "$sample/basic_no_fks_innodb.sql"); + +($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=t", + '--alter', 'drop column id') } +); + +like( + $output, + qr/neither --dry-run nor --execute was specified/, + "Doesn't run without --execute (bug 933232)" +) or diag($output); + +my $ddl = $master_dbh->selectrow_arrayref("show create table pt_osc.t"); +like( + $ddl->[1], + qr/^\s+["`]id["`]/m, + "Did not alter the table" +); + +is( + $exit, + 1, + "Exit 1" +); + +# ############################################################################# +# A helper sub to do the heavy lifting for us. +# ############################################################################# + +sub test_alter_table { + my (%args) = @_; + return if $args{skip}; + + my @required_args = qw(name table test_type cmds); + foreach my $arg ( @required_args ) { + die "I need a $arg argument" unless $args{$arg}; + } + my ($name, $table, $test_type, $cmds) = @args{@required_args}; + + my ($db, $tbl) = $q->split_unquote($table); + my $table_name = $tbl; + my $pk_col = $args{pk_col} || 'id'; + + if ( my $file = $args{file} ) { + $sb->load_file('master', "$sample/$file"); + $master_dbh->do("USE `$db`"); + $slave_dbh->do("USE `$db`"); + } + + my $ddl = $tp->get_create_table($master_dbh, $db, $tbl); + my $tbl_struct = $tp->parse($ddl); + + my $cols = '*'; + if ( $test_type =~ m/(?:add|drop)_col/ && !grep { $_ eq '--dry-run' } @$cmds ) { + # Don't select the column being dropped. + my $col = $args{drop_col} || $args{new_col}; + die "I need a drop_col argument" unless $col; + $cols = join(', ', grep { $_ ne $col } @{$tbl_struct->{cols}}); + } + my $orig_rows = $master_dbh->selectall_arrayref( + "SELECT $cols FROM $table ORDER BY `$pk_col`"); + + my $orig_tbls = $master_dbh->selectall_arrayref( + "SHOW TABLES FROM `$db`"); + + my $orig_max_id = $master_dbh->selectall_arrayref( + "SELECT MAX(`$pk_col`) FROM `$db`.`$tbl`"); + + my $triggers_sql = "SELECT TRIGGER_SCHEMA, TRIGGER_NAME, DEFINER, ACTION_STATEMENT, SQL_MODE, " + . " CHARACTER_SET_CLIENT, COLLATION_CONNECTION, EVENT_MANIPULATION, ACTION_TIMING " + . " FROM INFORMATION_SCHEMA.TRIGGERS " + . " WHERE TRIGGER_SCHEMA = '$db' " + . " AND EVENT_OBJECT_TABLE = '$tbl'"; + my $orig_triggers = $master_dbh->selectall_arrayref($triggers_sql); + + my ($orig_auto_inc) = $ddl =~ m/\s+AUTO_INCREMENT=(\d+)\s+/; + + my $fk_method = $args{check_fks}; + my @orig_fks; + if ( $fk_method ) { + foreach my $tbl ( @$orig_tbls ) { + my $fks = $tp->get_fks( + $tp->get_create_table($master_dbh, $db, $tbl->[0])); + push @orig_fks, $fks; + } + } + + # If --no-drop-new-table is given, then the new, altered table + # should still exist, but not yet, so add it to the list so + # is_deeply() against $new_tbls passes. This only works for + # single-table tests. + my $new_tbl = $args{new_table} || "_${tbl}_new"; + if ( grep { $_ eq '--no-drop-new-table' } @$cmds ) { + unshift @$orig_tbls, [$new_tbl]; + } + + ($output, $exit) = full_output( + sub { pt_online_schema_change::main( + @args, + '--print', + "$dsn,D=$db,t=$tbl", + @$cmds, + )}, + stderr => 1, + ); + + my $new_ddl = $tp->get_create_table($master_dbh, $db, $tbl); + my $new_tbl_struct = $tp->parse($new_ddl); + my $fail = 0; + + is( + $exit, + 0, + "$name exit 0" + ) or $fail = 1; + + # There should be no new or missing tables. + my $new_tbls = $master_dbh->selectall_arrayref("SHOW TABLES FROM `$db`"); + is_deeply( + $new_tbls, + $orig_tbls, + "$name tables" + ) or $fail = 1; + + # Rows in the original and new table should be identical. + my $new_rows = $master_dbh->selectall_arrayref("SELECT $cols FROM $table ORDER BY `$pk_col`"); + is_deeply( + $new_rows, + $orig_rows, + "$name rows" + ) or $fail = 1; + + if ( grep { $_ eq '--preserve-triggers' } @$cmds ) { + my $new_triggers = $master_dbh->selectall_arrayref($triggers_sql); + is_deeply( + $new_triggers, + $orig_triggers, + "$name triggers still exist" + ) or $fail = 1; + } + + if ( grep { $_ eq '--no-drop-new-table' } @$cmds ) { + $new_rows = $master_dbh->selectall_arrayref( + "SELECT $cols FROM `$db`.`$new_tbl` ORDER BY `$pk_col`"); + is_deeply( + $new_rows, + $orig_rows, + "$name new table rows" + ) or $fail = 1; + } + + my $new_max_id = $master_dbh->selectall_arrayref( + "SELECT MAX(`$pk_col`) FROM `$db`.`$tbl`"); + is( + $orig_max_id->[0]->[0], + $new_max_id->[0]->[0], + "$name MAX(pk_col)" + ) or $fail = 1; + + my ($new_auto_inc) = $new_ddl =~ m/\s+AUTO_INCREMENT=(\d+)\s+/; + is( + $orig_auto_inc, + $new_auto_inc, + "$name AUTO_INCREMENT=" . ($orig_auto_inc || '') + ) or $fail = 1; + + # Check if the ALTER was actually done. + if ( $test_type eq 'drop_col' ) { + my $col = $q->quote($args{drop_col}); + + if ( grep { $_ eq '--dry-run' } @$cmds ) { + like( + $new_ddl, + qr/^\s+$col\s+/m, + "$name ALTER DROP COLUMN=$args{drop_col} (dry run)" + ) or $fail = 1; + } + else { + unlike( + $new_ddl, + qr/^\s+$col\s+/m, + "$name ALTER DROP COLUMN=$args{drop_col}" + ) or $fail = 1; + } + } + elsif ( $test_type eq 'add_col' ) { + if ( $args{no_change} ) { + ok( + !$new_tbl_struct->{is_col}->{$args{new_col}}, + "$name $args{new_col} not added" + ); + } + else { + ok( + $new_tbl_struct->{is_col}->{$args{new_col}}, + "$name $args{new_col} added" + ); + } + } + elsif ( $test_type eq 'new_engine' ) { + my $new_engine = lc($args{new_engine}); + die "I need a new_engine argument" unless $new_engine; + my $rows = $master_dbh->selectall_hashref( + "SHOW TABLE STATUS FROM `$db`", "name"); + is( + lc($rows->{$tbl}->{engine}), + $new_engine, + "$name ALTER ENGINE=$args{new_engine}" + ) or $fail = 1; + + } + + if ( $fk_method ) { + my @new_fks; + my $rebuild_method = 0; + + foreach my $tbl ( @$orig_tbls ) { + my $fks = $tp->get_fks( + $tp->get_create_table($master_dbh, $db, $tbl->[0])); + + # The tool does not use the same/original fk name, + # it appends a single _. So we need to strip this + # to compare the original fks to the new fks. + # if ( $fk_method eq 'rebuild_constraints' ) { + if ( $fk_method eq 'rebuild_constraints' + || $table_name eq $tbl->[0] ) { + my %new_fks = map { + my $real_fk_name = $_; + my $fk_name = $_; + if ( $fk_name =~ s/^_// && $table_name ne $tbl->[0] ) { + $rebuild_method = 1; + } + $fks->{$real_fk_name}->{name} =~ s/^_//; + $fks->{$real_fk_name}->{ddl} =~ s/`$real_fk_name`/`$fk_name`/; + $fk_name => $fks->{$real_fk_name}; + } keys %$fks; + push @new_fks, \%new_fks; + } + else { + # drop_swap + push @new_fks, $fks; + } + } + + if ( grep { $_ eq '--execute' } @$cmds ) { + ok( + $fk_method eq 'rebuild_constraints' && $rebuild_method ? 1 + : $fk_method eq 'drop_swap' && !$rebuild_method ? 1 + : 0, + "$name FK $fk_method method" + ); + } + + is_deeply( + \@new_fks, + \@orig_fks, + "$name FK constraints" + ) or $fail = 1; + + # Go that extra mile and verify that the fks are actually + # still functiona: i.e. that they'll prevent us from delete + # a parent row that's being referenced by a child. + my $sql = "DELETE FROM $table WHERE $pk_col=1 LIMIT 1"; + eval { + $master_dbh->do($sql); + }; + like( + $EVAL_ERROR, + qr/foreign key constraint fails/, + "$name FK constraints still hold" + ) or $fail = 1; + } + + if ( $fail ) { + diag("Output from failed test:\n$output"); + } + elsif ( $args{output} ) { + warn $output; + } + + return; +} + +# ############################################################################# +# The most basic: alter a small table with no fks that's not active. +# ############################################################################# + +my $db_flavor = VersionParser->new($master_dbh)->flavor(); +if ( $db_flavor =~ m/XtraDB Cluster/ ) { + test_alter_table( + name => "Basic no fks --dry-run", + table => "pt_osc.t", + file => "basic_no_fks_innodb.sql", + max_id => 20, + test_type => "drop_col", + drop_col => "d", + cmds => [qw(--dry-run --alter), 'DROP COLUMN d'], + ); + + test_alter_table( + name => "Basic no fks --execute", + table => "pt_osc.t", + # The previous test should not have modified the table. + # file => "basic_no_fks_innodb.sql", + # max_id => 20, + test_type => "drop_col", + drop_col => "d", + cmds => [qw(--execute --alter), 'DROP COLUMN d'], + ); + + test_alter_table( + name => "--execute but no --alter", + table => "pt_osc.t", + file => "basic_no_fks_innodb.sql", + max_id => 20, + test_type => "new_engine", # When there's no change, we just check + new_engine => "InnoDB", # the engine as a NOP. Any other + cmds => [qw(--execute)], # unintended changes are still detected. + ); +} +else { + test_alter_table( + name => "Basic no fks --dry-run", + table => "pt_osc.t", + file => "basic_no_fks.sql", + max_id => 20, + test_type => "new_engine", + new_engine => "MyISAM", + cmds => [qw(--dry-run --alter ENGINE=InnoDB)], + ); + + test_alter_table( + name => "Basic no fks --execute", + table => "pt_osc.t", + # The previous test should not have modified the table. + # file => "basic_no_fks.sql", + # max_id => 20, + test_type => "new_engine", + new_engine => "InnoDB", + cmds => [qw(--execute --alter ENGINE=InnoDB)], + ); + + test_alter_table( + name => "--execute but no --alter", + table => "pt_osc.t", + file => "basic_no_fks.sql", + max_id => 20, + test_type => "new_engine", + new_engine => "MyISAM", + cmds => [qw(--execute)], + ); +} + +# ############################################################################ +# Alter a table with foreign keys. +# ############################################################################ + +# The tables we're loading have fk constraints like: +# country <-- city <-- address + +# rebuild_constraints method -- This parses the fk constraint ddls from +# the create table ddl, rewrites them, then does an alter table on the +# child tables so they point back to the original table name. + +test_alter_table( + name => "Basic FK rebuild --dry-run", + table => "pt_osc.country", + pk_col => "country_id", + file => "basic_with_fks.sql", + test_type => "drop_col", + drop_col => "last_update", + check_fks => "rebuild_constraints", + cmds => [ + qw( + --dry-run + --alter-foreign-keys-method rebuild_constraints + ), + '--alter', 'DROP COLUMN last_update', + ], +); + +test_alter_table( + name => "Basic FK rebuild --execute", + table => "pt_osc.country", + pk_col => "country_id", + test_type => "drop_col", + drop_col => "last_update", + check_fks => "rebuild_constraints", + cmds => [ + qw( + --execute + --alter-foreign-keys-method rebuild_constraints + ), + '--alter', 'DROP COLUMN last_update', + ], +); + +# drop_swap method -- This method tricks MySQL by disabling fk checks, +# then dropping the original table and renaming the new table in its place. +# Since fk checks were disabled, MySQL doesn't update the child table fk refs. +# Somewhat dangerous, but quick. Downside: table doesn't exist for a moment. + +test_alter_table( + name => "Basic FK drop_swap --dry-run", + table => "pt_osc.country", + pk_col => "country_id", + file => "basic_with_fks.sql", + test_type => "drop_col", + drop_col => "last_update", + check_fks => "drop_swap", + cmds => [ + qw( + --dry-run + --alter-foreign-keys-method drop_swap + ), + '--alter', 'DROP COLUMN last_update', + ], +); + +test_alter_table( + name => "Basic FK drop_swap --execute", + table => "pt_osc.country", + pk_col => "country_id", + test_type => "drop_col", + drop_col => "last_update", + check_fks => "drop_swap", + cmds => [ + qw( + --execute + --alter-foreign-keys-method drop_swap + ), + '--alter', 'DROP COLUMN last_update', + ], +); + +# Let the tool auto-determine the fk update method. This should choose +# the rebuild_constraints method because the tables are quite small. +# This is tested by indicating the rebuild_constraints method, which +# causes the test sub to verify that the fks have leading _; they won't +# if drop_swap was used. To verify this, change auto to drop_swap +# and this test will fail. +test_alter_table( + name => "Basic FK auto --execute", + table => "pt_osc.country", + pk_col => "country_id", + file => "basic_with_fks.sql", + test_type => "drop_col", + drop_col => "last_update", + check_fks => "rebuild_constraints", + cmds => [ + qw( + --execute + --alter-foreign-keys-method auto + ), + '--alter', 'DROP COLUMN last_update', + ], +); + +# Specify --alter-foreign-keys-method for a table with no child tables. +test_alter_table( + name => "Child table", + table => "pt_osc.address", + pk_col => "address_id", + file => "basic_with_fks.sql", + test_type => "new_engine", + new_engine => "innodb", + cmds => [ + qw( + --execute + --alter-foreign-keys-method auto + ), + '--alter', 'ENGINE=INNODB', + ], +); + +# Use drop_swap to alter address, which no other table references, +# so the tool should re-enable --swap-tables and --drop-old-table. +test_alter_table( + name => "Drop-swap child", + table => "pt_osc.address", + pk_col => "address_id", + file => "basic_with_fks.sql", + test_type => "drop_col", + drop_col => "last_update", + cmds => [ + qw( + --execute + --alter-foreign-keys-method drop_swap + ), + '--alter', 'DROP COLUMN last_update', + ], +); + +# Alter city and verify that its fk to country still exists. +# (https://bugs.launchpad.net/percona-toolkit/+bug/969726) +test_alter_table( + name => "Preserve all fks", + table => "pt_osc.city", + pk_col => "city_id", + file => "basic_with_fks.sql", + test_type => "drop_col", + drop_col => "last_update", + check_fks => "rebuild_constraints", + cmds => [ + qw( + --execute + --alter-foreign-keys-method rebuild_constraints + ), + '--alter', 'DROP COLUMN last_update', + ], +); + +SKIP: { + skip 'Sandbox master does not have the sakila database', 7 + unless @{$master_dbh->selectcol_arrayref("SHOW DATABASES LIKE 'sakila'")}; + + # This test will use the drop_swap method because the child tables + # are large. To prove this, change check_fks to rebuild_constraints + # and the test will fail. + test_alter_table( + name => "sakila.staff", + table => "sakila.staff", + pk_col => "staff_id", + test_type => "new_engine", + new_engine => "InnoDB", + check_fks => "drop_swap", + cmds => [ + qw( + --chunk-size 100 + --execute + --alter-foreign-keys-method auto + ), + '--alter', 'ENGINE=InnoDB' + ], + ); + + # Restore the original fks. + diag('Restoring sakila...'); + diag(`$trunk/sandbox/load-sakila-db 12345`); +} + +# ############################################################################# +# --alter-foreign-keys-method=none. This intentionally breaks fks because +# they're not updated so they'll point to the old table that is dropped. +# ############################################################################# + +# Specify --alter-foreign-keys-method for a table with no child tables. +test_alter_table( + name => "Update fk method none", + file => "basic_with_fks.sql", + table => "pt_osc.country", + pk_col => "country_id", + max_id => 20, + test_type => "new_engine", + new_engine => "innodb", + cmds => [ + qw(--execute --alter-foreign-keys-method none --force --alter ENGINE=INNODB) + ], +); + +my $fks = $tp->get_fks( + $tp->get_create_table($master_dbh, "pt_osc", "city")); +is( + $fks->{fk_city_country}->{parent_tbl}->{tbl}, + "_country_old", + "--alter-foreign-keys-method=none" +); + +# ############################################################################# +# Alter tables with columns with resvered words and spaces. +# ############################################################################# +sub test_table { + my (%args) = @_; + my ($file, $name) = @args{qw(file name)}; + + $sb->load_file('master', "t/lib/samples/osc/$file"); + $master_dbh->do('use osc'); + $master_dbh->do("DROP TABLE IF EXISTS osc.__new_t"); + + my $org_rows = $master_dbh->selectall_arrayref('select * from osc.t order by id'); + + ($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, + "$dsn,D=osc,t=t", qw(--execute --alter ENGINE=InnoDB)) }, + stderr => 1, + ); + + my $new_rows = $master_dbh->selectall_arrayref('select * from osc.t order by id'); + + my $fail = 0; + + is_deeply( + $new_rows, + $org_rows, + "$name rows" + ) or $fail = 1; + + is( + $exit, + 0, + "$name exit status 0" + ) or $fail = 1; + + if ( $fail ) { + diag("Output from failed test:\n$output"); + } +} + +test_table( + file => "tbl002.sql", + name => "Reserved word column", +); + +test_table( + file => "tbl003.sql", + name => "Space column", +); + +# ############################################################################# +# --[no]swap-tables +# ############################################################################# + +test_alter_table( + name => "--no-swap-tables", + table => "pt_osc.t", + file => "basic_no_fks_innodb.sql", + max_id => 20, + test_type => "add_col", + new_col => "foo", + no_change => 1, + cmds => [ + qw(--execute --no-swap-tables), '--alter', 'ADD COLUMN foo INT' + ], +); + +test_alter_table( + name => "--no-swap-tables --no-drop-new-table", + table => "pt_osc.t", + file => "basic_no_fks_innodb.sql", + max_id => 20, + test_type => "add_col", + new_col => "foo", + no_change => 1, + cmds => [ + qw(--execute --no-swap-tables), '--alter', 'ADD COLUMN foo INT', + qw(--no-drop-new-table), + ], +); + +# ############################################################################# +# --statistics +# ############################################################################# + +$sb->load_file('master', "$sample/bug_1045317.sql"); + +ok( + no_diff( + sub { pt_online_schema_change::main(@args, "$dsn,D=bug_1045317,t=bits", + '--dry-run', '--statistics', + '--alter', "modify column val ENUM('M','E','H') NOT NULL") + }, + "$sample/stats-dry-run.txt", + update_sample => 1, + ), + "--statistics --dry-run" +) or diag($test_diff); + +# 5.5, 5.6 and 5.7 have different outputs +my $res_file = "$sample/stats-execute.txt"; +if ($sandbox_version eq '5.5' && $db_flavor !~ m/XtraDB Cluster/) { + $res_file = "$sample/stats-execute-5.5.txt"; +} elsif ($sandbox_version eq '5.6' && $db_flavor !~ m/XtraDB Cluster/) { + $res_file = "$sample/stats-execute-5.6.txt"; +} elsif ($sandbox_version eq '5.7' && $db_flavor !~ m/XtraDB Cluster/) { + $res_file = "$sample/stats-execute-5.7.txt"; +} + + +ok( + no_diff( + sub { pt_online_schema_change::main(@args, "$dsn,D=bug_1045317,t=bits", + '--execute', '--statistics', + '--alter', "modify column val ENUM('M','E','H') NOT NULL", + '--recursion-method', 'none'), + }, + $res_file, + keep_output=>1, + ), + "--statistics --execute" +) or diag($test_diff); + + +# ############################################################################# +# --chunk-size-limit=0 must not skip tables that would be chunked +# in one nibble +# https://bugs.launchpad.net/percona-toolkit/+bug/1441928 +# ############################################################################# + +($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, + "$dsn,D=sakila,t=actor", qw(--chunk-size-limit 0 --alter-foreign-keys-method drop_swap --execute --alter ENGINE=InnoDB)) }, + stderr => 1, +); + +like( + $output, + qr/Successfully altered/i, + "--chunk-size-limit=0 doesn't skip tables - lp1441928" +); + + +# ############################################################################# +# --default-engine +# ############################################################################# + +SKIP: { + skip "--default-engine tests require < MySQL 5.5", 1 + if $sandbox_version ge '5.5'; + + # The alter doesn't actually change the engine (test_type), + # but the --default-engine does because the table uses InnoDB + # but MyISAM is the default engine before MySQL 5.5. + test_alter_table( + name => "--default-engine", + table => "pt_osc.t", + file => "default-engine.sql", + test_type => "new_engine", + new_engine => "MyISAM", + cmds => [ + '--default-engine', + '--execute', + '--alter', 'ADD INDEX (d)', + ], + ); +} + +# ############################################################################# +# --new-table-name +# ############################################################################# + +test_alter_table( + name => "--new-table-name %T_foo", + table => "pt_osc.t", + file => "basic_no_fks_innodb.sql", + max_id => 20, + test_type => "add_col", + new_col => "foo", + cmds => [ + qw(--execute --new-table-name %T_foo), '--alter', 'ADD COLUMN foo INT' + ], +); + +test_alter_table( + name => "--new-table-name static_new", + table => "pt_osc.t", + max_id => 20, + test_type => "drop_col", + drop_col => "foo", + new_table => 'static_new', + cmds => [ + qw(--execute --new-table-name static_new), '--alter', 'DROP COLUMN foo' + ], +); + +# ############################################################################# +# --recursion-method=dns (lp: 1523685) +# ############################################################################# + +$sb->load_file('master', "$sample/create_dsns.sql"); + +($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, + "$dsn,D=sakila,t=actor", ('--recursion-method=dsn=D=test_recursion_method,t=dsns,h=127.0.0.1,P=12345,u=msandbox,p=msandbox', + '--alter-foreign-keys-method', 'drop_swap', '--execute', '--alter', 'ENGINE=InnoDB')) + }, + stderr => 1, +); + +like( + $output, + qr/Found 2 slaves.*Successfully altered/si, + "--recursion-method=dns works" +); + +$master_dbh->do("DROP DATABASE test_recursion_method"); + +diag("Reloading sakila"); +my $master_port = $sb->port_for('master'); +system "$trunk/sandbox/load-sakila-db $master_port &"; + +$sb->do_as_root("master", q/GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY 'slave_password'/); +$sb->do_as_root("master", q/set sql_log_bin=0/); +$sb->do_as_root("master", q/DROP USER 'slave_user'/); +$sb->do_as_root("master", q/set sql_log_bin=1/); + +test_alter_table( + name => "--slave-user --slave-password", + file => "basic_no_fks_innodb.sql", + table => "pt_osc.t", + test_type => "add_col", + new_col => "bar", + cmds => [ + qw(--execute --slave-user slave_user --slave-password slave_password), '--alter', 'ADD COLUMN bar INT', + ], +); +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +# +done_testing; diff --git a/t/pt-online-schema-change/bugs.t b/t/pt-online-schema-change/bugs.t index ae3db4cb..3b072c8a 100644 --- a/t/pt-online-schema-change/bugs.t +++ b/t/pt-online-schema-change/bugs.t @@ -445,6 +445,31 @@ $output = output( # clear databases with their foreign keys $sb->load_file('master', "$sample/bug-1315130_cleanup.sql"); +# ############################################################################# +# Issue 1315130 +# Failed to detect child tables in other schema, and falsely identified +# child tables in own schema +# ############################################################################# + +$sb->load_file('master', "$sample/bug-1315130_cleanup.sql"); +$sb->load_file('master', "$sample/bug-1315130.sql"); + +$output = output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=bug_1315130_a,t=parent_table", + '--dry-run', + '--alter', "add column c varchar(16)", + '--alter-foreign-keys-method', 'auto', '--only-same-schema-fks'), + }, +); + +like( + $output, + qr/Child tables:\s*`bug_1315130_a`\.`child_table_in_same_schema` \(approx\. 1 rows\)[^`]*?Will/s, + "Ignore child tables in other schemas.", +); +# clear databases with their foreign keys +$sb->load_file('master', "$sample/bug-1315130_cleanup.sql"); + # ############################################################################# # Issue 1340728 diff --git a/t/pt-online-schema-change/issue-1646713.t b/t/pt-online-schema-change/issue-1646713.t index f077349f..3d716db8 100644 --- a/t/pt-online-schema-change/issue-1646713.t +++ b/t/pt-online-schema-change/issue-1646713.t @@ -57,7 +57,7 @@ sub start_thread { $dbh->do("UPDATE `test`.`o1` SET id=0 WHERE id=1"); diag("Row updated"); } -my $thr = threads->create('start_thread', $dsn_opts, 3); +my $thr = threads->create('start_thread', $dsn_opts, 1); $thr->detach(); threads->yield(); @@ -72,7 +72,6 @@ $output = output( }, ); - like( $output, qr/Successfully altered/s, diff --git a/t/pt-online-schema-change/long_fk_constraints.t b/t/pt-online-schema-change/long_fk_constraints.t new file mode 100644 index 00000000..1ef52ed8 --- /dev/null +++ b/t/pt-online-schema-change/long_fk_constraints.t @@ -0,0 +1,75 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout-3 else the +# tool will die. +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; +my @args = (qw(--set-vars innodb_lock_wait_timeout=3 --alter-foreign-keys-method rebuild_constraints)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +# ############################################################################ +# https://bugs.launchpad.net/percona-toolkit/+bug/1215587 +# Adding _ to constraints can create issues with constraint name length +# ############################################################################ + +$sb->load_file('master', "$sample/long_fk_constraints.sql"); + +# run once: we expect constraint names to be prefixed with one underscore +# if they havre't one, and to remove 2 if they have 2 +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, + "$master_dsn,D=bug1215587,t=Table1", + "--alter", "ENGINE=InnoDB", + qw(--execute)) }, +); + +warn $output; + +my $constraints = $master_dbh->selectall_arrayref("SELECT TABLE_NAME, CONSTRAINT_NAME FROM information_schema.KEY_COLUMN_USAGE WHERE table_schema='bug1215587' and (TABLE_NAME='Table1' OR TABLE_NAME='Table2') and CONSTRAINT_NAME LIKE '%fkey%' ORDER BY TABLE_NAME, CONSTRAINT_NAME"); + +warn Data::Dumper::Dumper($constraints); + +is_deeply( + $constraints, + [ + [ 'Table1', '__fkey1a' ], + [ 'Table1', '__fkey_SALES_RECURRING_PROFILE_CUSTOMER_CUSTOMER_ENTITY_ENTITY_I' ], + [ 'Table2', '_fkey2a' ], + [ 'Table2', '__fkey2b' ] + ], + "First run adds or removes underscore from constraint names, accordingly" +); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/preserve_triggers.t b/t/pt-online-schema-change/preserve_triggers.t new file mode 100644 index 00000000..85ee1132 --- /dev/null +++ b/t/pt-online-schema-change/preserve_triggers.t @@ -0,0 +1,473 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; +use Time::HiRes qw(sleep); + +$ENV{PTTEST_FAKE_TS} = 1; +$ENV{PERCONA_TOOLKIT_TEST_USE_DSN_NAMES} = 1; + +use PerconaTest; +use Sandbox; +require "$trunk/bin/pt-online-schema-change"; +require VersionParser; + +use Data::Dumper; +$Data::Dumper::Indent = 1; +$Data::Dumper::Sortkeys = 1; +$Data::Dumper::Quotekeys = 0; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $slave_dbh = $sb->get_dbh_for('slave1'); + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +elsif ( !$slave_dbh ) { + plan skip_all => 'Cannot connect to sandbox slave'; +} + +my $q = new Quoter(); +my $tp = new TableParser(Quoter => $q); +my @args = qw(--set-vars innodb_lock_wait_timeout=3); +my $output = ""; +my $dsn = "h=127.1,P=12345,u=msandbox,p=msandbox"; +my $exit = 0; +my $sample = "t/pt-online-schema-change/samples"; +my $rows; + +# ############################################################################# +# A helper sub to do the heavy lifting for us. +# ############################################################################# + +sub test_alter_table { + my (%args) = @_; + return if $args{skip}; + + my @required_args = qw(name table test_type cmds); + foreach my $arg ( @required_args ) { + die "I need a $arg argument" unless $args{$arg}; + } + my ($name, $table, $test_type, $cmds) = @args{@required_args}; + + my ($db, $tbl) = $q->split_unquote($table); + my $table_name = $tbl; + my $pk_col = $args{pk_col} || 'id'; + my $delete_triggers = $args{delete_triggers} || ''; + + if ( my $file = $args{file} ) { + $sb->load_file('master', "$sample/$file"); + $master_dbh->do("USE `$db`"); + $slave_dbh->do("USE `$db`"); + } + + my $ddl = $tp->get_create_table($master_dbh, $db, $tbl); + my $tbl_struct = $tp->parse($ddl); + + my $cols = '*'; + if ( $test_type =~ m/(?:add|drop)_col/ && !grep { $_ eq '--dry-run' } @$cmds ) { + # Don't select the column being dropped. + my $col = $args{drop_col} || $args{new_col}; + die "I need a drop_col argument" unless $col; + $cols = join(', ', grep { $_ ne $col } @{$tbl_struct->{cols}}); + } + my $orig_rows = $master_dbh->selectall_arrayref( + "SELECT $cols FROM $table ORDER BY `$pk_col`"); + + my $orig_tbls = $master_dbh->selectall_arrayref( + "SHOW TABLES FROM `$db`"); + + my $orig_max_id = $master_dbh->selectall_arrayref( + "SELECT MAX(`$pk_col`) FROM `$db`.`$tbl`"); + + my $triggers_sql = "SELECT TRIGGER_SCHEMA, TRIGGER_NAME, DEFINER, ACTION_STATEMENT, SQL_MODE, " + . " CHARACTER_SET_CLIENT, COLLATION_CONNECTION, EVENT_MANIPULATION, ACTION_TIMING " + . " FROM INFORMATION_SCHEMA.TRIGGERS " + . " WHERE TRIGGER_SCHEMA = '$db' " + . " AND EVENT_OBJECT_TABLE = '$tbl'"; + my $orig_triggers = $master_dbh->selectall_arrayref($triggers_sql); + + my ($orig_auto_inc) = $ddl =~ m/\s+AUTO_INCREMENT=(\d+)\s+/; + + my $fk_method = $args{check_fks}; + my @orig_fks; + if ( $fk_method ) { + foreach my $tbl ( @$orig_tbls ) { + my $fks = $tp->get_fks( + $tp->get_create_table($master_dbh, $db, $tbl->[0])); + push @orig_fks, $fks; + } + } + + # If --no-drop-new-table is given, then the new, altered table + # should still exist, but not yet, so add it to the list so + # is_deeply() against $new_tbls passes. This only works for + # single-table tests. + my $new_tbl = $args{new_table} || "_${tbl}_new"; + if ( grep { $_ eq '--no-drop-new-table' } @$cmds ) { + unshift @$orig_tbls, [$new_tbl]; + } + + ($output, $exit) = full_output( + sub { pt_online_schema_change::main( + @args, + '--print', + "$dsn,D=$db,t=$tbl", + @$cmds, + )}, + stderr => 1, + ); + + my $new_ddl = $tp->get_create_table($master_dbh, $db, $tbl); + my $new_tbl_struct = $tp->parse($new_ddl); + my $fail = 0; + + is( + $exit, + 0, + "$name exit 0" + ) or $fail = 1; + + # There should be no new or missing tables. + my $new_tbls = $master_dbh->selectall_arrayref("SHOW TABLES FROM `$db`"); + is_deeply( + $new_tbls, + $orig_tbls, + "$name tables" + ) or $fail = 1; + + # Rows in the original and new table should be identical. + my $new_rows = $master_dbh->selectall_arrayref("SELECT $cols FROM $table ORDER BY `$pk_col`"); + is_deeply( + $new_rows, + $orig_rows, + "$name rows" + ) or $fail = 1; + + if ( grep { $_ eq '--preserve-triggers' } @$cmds && !$delete_triggers) { + my $new_triggers = $master_dbh->selectall_arrayref($triggers_sql); + is_deeply( + $new_triggers, + $orig_triggers, + "$name triggers still exist" + ) or $fail = 1; + } + + if ( grep { $_ eq '--no-drop-new-table' } @$cmds ) { + $new_rows = $master_dbh->selectall_arrayref( + "SELECT $cols FROM `$db`.`$new_tbl` ORDER BY `$pk_col`"); + is_deeply( + $new_rows, + $orig_rows, + "$name new table rows" + ) or $fail = 1; + } + + my $new_max_id = $master_dbh->selectall_arrayref( + "SELECT MAX(`$pk_col`) FROM `$db`.`$tbl`"); + is( + $orig_max_id->[0]->[0], + $new_max_id->[0]->[0], + "$name MAX(pk_col)" + ) or $fail = 1; + + my ($new_auto_inc) = $new_ddl =~ m/\s+AUTO_INCREMENT=(\d+)\s+/; + is( + $orig_auto_inc, + $new_auto_inc, + "$name AUTO_INCREMENT=" . ($orig_auto_inc || '') + ) or $fail = 1; + + # Check if the ALTER was actually done. + if ( $test_type eq 'drop_col' ) { + my $col = $q->quote($args{drop_col}); + + if ( grep { $_ eq '--dry-run' } @$cmds ) { + like( + $new_ddl, + qr/^\s+$col\s+/m, + "$name ALTER DROP COLUMN=$args{drop_col} (dry run)" + ) or $fail = 1; + } + else { + unlike( + $new_ddl, + qr/^\s+$col\s+/m, + "$name ALTER DROP COLUMN=$args{drop_col}" + ) or $fail = 1; + } + } + elsif ( $test_type eq 'add_col' ) { + if ( $args{no_change} ) { + ok( + !$new_tbl_struct->{is_col}->{$args{new_col}}, + "$name $args{new_col} not added" + ); + } + else { + ok( + $new_tbl_struct->{is_col}->{$args{new_col}}, + "$name $args{new_col} added" + ); + } + } + elsif ( $test_type eq 'new_engine' ) { + my $new_engine = lc($args{new_engine}); + die "I need a new_engine argument" unless $new_engine; + my $rows = $master_dbh->selectall_hashref( + "SHOW TABLE STATUS FROM `$db`", "name"); + is( + lc($rows->{$tbl}->{engine}), + $new_engine, + "$name ALTER ENGINE=$args{new_engine}" + ) or $fail = 1; + + } + + if ( $fk_method ) { + my @new_fks; + my $rebuild_method = 0; + + foreach my $tbl ( @$orig_tbls ) { + my $fks = $tp->get_fks( + $tp->get_create_table($master_dbh, $db, $tbl->[0])); + + # The tool does not use the same/original fk name, + # it appends a single _. So we need to strip this + # to compare the original fks to the new fks. + # if ( $fk_method eq 'rebuild_constraints' ) { + if ( $fk_method eq 'rebuild_constraints' + || $table_name eq $tbl->[0] ) { + my %new_fks = map { + my $real_fk_name = $_; + my $fk_name = $_; + if ( $fk_name =~ s/^_// && $table_name ne $tbl->[0] ) { + $rebuild_method = 1; + } + $fks->{$real_fk_name}->{name} =~ s/^_//; + $fks->{$real_fk_name}->{ddl} =~ s/`$real_fk_name`/`$fk_name`/; + $fk_name => $fks->{$real_fk_name}; + } keys %$fks; + push @new_fks, \%new_fks; + } + else { + # drop_swap + push @new_fks, $fks; + } + } + + if ( grep { $_ eq '--execute' } @$cmds ) { + ok( + $fk_method eq 'rebuild_constraints' && $rebuild_method ? 1 + : $fk_method eq 'drop_swap' && !$rebuild_method ? 1 + : 0, + "$name FK $fk_method method" + ); + } + + is_deeply( + \@new_fks, + \@orig_fks, + "$name FK constraints" + ) or $fail = 1; + + # Go that extra mile and verify that the fks are actually + # still functiona: i.e. that they'll prevent us from delete + # a parent row that's being referenced by a child. + my $sql = "DELETE FROM $table WHERE $pk_col=1 LIMIT 1"; + eval { + $master_dbh->do($sql); + }; + like( + $EVAL_ERROR, + qr/foreign key constraint fails/, + "$name FK constraints still hold" + ) or $fail = 1; + } + + if ( $fail ) { + diag("Output from failed test:\n$output"); + } + elsif ( $args{output} ) { + warn $output; + } + + return; +} +# ############################################################################# +# Tests for --preserve-triggers option +# ############################################################################# + +SKIP: { + skip 'Sandbox MySQL version should be >= 5.7' unless $sandbox_version ge '5.7'; + + test_alter_table( + name => 'Basic --preserve-triggers', + table => "pt_osc.account", + pk_col => "id", + file => "triggers.sql", + test_type => "add_col", + new_col => "foo", + cmds => [ + qw(--execute --preserve-triggers), '--alter', 'ADD COLUMN foo INT', + ], + ); + + test_alter_table( + name => "--preserve-triggers: after triggers", + table => "test.t1", + pk_col => "id", + file => "after_triggers.sql", + test_type => "add_col", + new_col => "foo3", + cmds => [ + qw(--execute --preserve-triggers --alter-foreign-keys-method rebuild_constraints), '--alter', 'ADD COLUMN foo3 INT', + ], + ); + + + $sb->load_file('master', "$sample/after_triggers.sql"); + + ($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, + "$dsn,D=test,t=t1", + qw(--execute --preserve-triggers), '--alter', 'DROP COLUMN f1') + }, + stderr => 1, + ); + + isnt( + $exit, + 0, + "--preserve-triggers cannot drop column used by trigger", + ); + + like( + $output, + qr/Check if all fields referenced by the trigger still exists after the operation you are trying to apply/, + "--preserve-triggers: message if try to drop a field used by triggers", + ); + + ($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, + "$dsn,D=test,t=t1", + qw(--execute --no-swap-tables --preserve-triggers), '--alter', 'ADD COLUMN foo INT') + }, + stderr => 1, + ); + + is( + $exit, + 0, + "--preserve-triggers --no-swap-tables exit status", + ); + + $sb->load_file('master', "$sample/after_triggers.sql"); + + ($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, + "$dsn,D=test,t=t1", + qw(--execute --no-drop-old-table --preserve-triggers), '--alter', 'ADD COLUMN foo INT') + }, + stderr => 1, + ); + + is( + $exit, + 0, + "--preserve-triggers --no-drop-old-table exit status", + ); + + my $rows = $master_dbh->selectall_arrayref("SHOW TABLES LIKE '%t1%'"); + is_deeply( + $rows, + [ [ '_t1_old' ], [ 't1' ] ], + "--preserve-triggers --no-drop-old-table original & new tables still exists", + ); + + ($output, $exit) = full_output( + sub { pt_online_schema_change::main(@args, + "$dsn,D=pt_osc,t=t", + qw(--execute --no-drop-triggers --preserve-triggers), '--alter', 'ADD COLUMN foo INT') + }, + stderr => 1, + ); + + isnt( + $exit, + 0, + "--preserve-triggers cannot be used --no-drop-triggers", + ); + + test_alter_table( + name => "Basic FK auto --execute", + table => "pt_osc.country", + pk_col => "country_id", + file => "basic_with_fks.sql", + test_type => "drop_col", + drop_col => "last_update", + check_fks => "rebuild_constraints", + cmds => [ + qw( + --execute + --alter-foreign-keys-method rebuild_constraints + --preserve-triggers + ), + '--alter', 'DROP COLUMN last_update', + ], + ); + + test_alter_table( + name => "--preserve-triggers: --no-swap-tables --drop-new-table", + table => "test.t1", + pk_col => "id", + file => "after_triggers.sql", + test_type => "add_col", + new_col => "foo4", + no_change => 1, + delete_triggers => 1, + cmds => [ + qw(--execute --preserve-triggers --no-swap-tables --drop-new-table + --alter-foreign-keys-method rebuild_constraints), + '--alter', 'ADD COLUMN foo4 INT', + ], + ); + +} + +diag("Reloading sakila"); +my $master_port = $sb->port_for('master'); +system "$trunk/sandbox/load-sakila-db $master_port &"; + +$sb->do_as_root("master", q/GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY 'slave_password'/); +$sb->do_as_root("master", q/set sql_log_bin=0/); +$sb->do_as_root("master", q/DROP USER 'slave_user'/); +$sb->do_as_root("master", q/set sql_log_bin=1/); + +test_alter_table( + name => "--slave-user --slave-password", + file => "basic_no_fks_innodb.sql", + table => "pt_osc.t", + test_type => "add_col", + new_col => "bar", + cmds => [ + qw(--execute --slave-user slave_user --slave-password slave_password), '--alter', 'ADD COLUMN bar INT', + ], +); +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +# +done_testing; diff --git a/t/pt-online-schema-change/pt-116.t b/t/pt-online-schema-change/pt-116.t deleted file mode 100644 index e355730b..00000000 --- a/t/pt-online-schema-change/pt-116.t +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env perl - -BEGIN { - die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" - unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; - unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; -}; - -use strict; -use warnings FATAL => 'all'; - -use English qw(-no_match_vars); -use Test::More; - -use Data::Dumper; -use PerconaTest; -use Sandbox; -use SqlModes; -use File::Temp qw/ tempdir /; - -plan tests => 8; - -require "$trunk/bin/pt-online-schema-change"; - -my $dp = new DSNParser(opts=>$dsn_opts); -my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); - -my $master_dbh = $sb->get_dbh_for('master'); -my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; - -if ( !$master_dbh ) { - plan skip_all => 'Cannot connect to sandbox master'; -} - -# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic -# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the -# tool will die. -my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); -my $output; -my $exit_status; -my $sample = "t/pt-online-schema-change/samples/"; - -$sb->load_file('master', "$sample/pt-116.sql"); - -my $dir = tempdir( CLEANUP => 1 ); -($output, $exit_status) = full_output( - sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", - '--execute', - '--alter', "ADD UNIQUE INDEX unique_1 (notunique)", - '--chunk-size', '1', - ), - }, - stderr => 1, -); - -like( - $output, - qr/It seems like/s, - "Need to specify use-insert-ignore", -); - -($output, $exit_status) = full_output( - sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", - '--execute', - '--alter', "ADD UNIQUE INDEX unique_1 (notunique)", - '--chunk-size', '1', - '--nouse-insert-ignore', - ), - }, - stderr => 1, -); - -like( - $output, - qr/Error copying rows from/s, - "Error adding unique index not using insert ignore", -); - -isnt( - $exit_status, - 0, - "Got error adding unique index (exit status != 0)", -); - -# Check no data was deleted from the original table -my $rows = $master_dbh->selectrow_arrayref( - "SELECT COUNT(*) FROM `test`.`t1`"); -is( - $rows->[0], - 3, - "ALTER ADD UNIQUE key on a field having duplicated values" -) or diag(Dumper($rows)); - - -# # This test looks weird but since we added use-insert-ignore, we know in this particular -# # case, having the testing dataset with repeated values for the field on which we are -# # adding a unique will lose data. -# # It is not the intention of this test to lose data, but we need to test the INSERT statement -# # was created as expected. -($output, $exit_status) = full_output( - sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", - '--execute', - '--alter', "ADD UNIQUE INDEX unique_1 (notunique)", - '--chunk-size', '1', - '--use-insert-ignore', - ), - }, - stderr => 1, -); - - -like( - $output, - qr/Successfully altered/s, - "Error adding unique index not using insert ignore", -); - -is( - $exit_status, - 0, - "Added unique index and some rows got lost (exit status = 0)", -); - -# Check no data was deleted from the original table -$rows = $master_dbh->selectrow_arrayref( - "SELECT COUNT(*) FROM `test`.`t1`"); -is( - $rows->[0], - 2, - "Added unique index and some rows got lost (row count = original - 1)", -) or diag(Dumper($rows)); - -$master_dbh->do("DROP DATABASE IF EXISTS test"); - -# ############################################################################# -# Done. -# ############################################################################# -$sb->wipe_clean($master_dbh); -ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); -done_testing; diff --git a/t/pt-online-schema-change/pt-153.t b/t/pt-online-schema-change/pt-153.t new file mode 100644 index 00000000..756c2bd7 --- /dev/null +++ b/t/pt-online-schema-change/pt-153.t @@ -0,0 +1,98 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 6; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-153.sql"); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', + '--alter', "ADD UNIQUE INDEX c1 (f2, f3)", + ), + }, +); + +isnt( + $exit_status, + 0, + "PT-153 Adding unique index exit status != 0.", +); + +like( + $output, + qr/You are trying to add an unique key. This can result in data loss if the data is not unique/s, + "PT-153 Adding unique index warning message.", +); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', + '--alter', "ADD UNIQUE INDEX c1 (f2, f3), PRIMARY KEY (f3), UNIQUE KEY k2 (f3)", + ), + }, +); + +isnt( + $exit_status, + 0, + "PT-153 Adding multiple unique indexes exit status != 0.", +); + +like( + $output, + qr/You are trying to add an unique key. This can result in data loss if the data is not unique/s, + "PT-153 Adding multiple unique indexes warning message.", +); + +like( + $output, + qr/SELECT IF\(COUNT\(DISTINCT f2, f3\).*?SELECT IF\(COUNT\(DISTINCT f3\)/s, + "PT-153 Adding multiple unique indexes -> multime example queries.", +); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/pt-186.t b/t/pt-online-schema-change/pt-186.t new file mode 100644 index 00000000..0573e667 --- /dev/null +++ b/t/pt-online-schema-change/pt-186.t @@ -0,0 +1,91 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 4; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-186.sql"); + +my $ori_rows = $master_dbh->selectall_arrayref('SELECT * FROM test.t1'); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', '--no-check-alter', + '--alter', 'CHANGE COLUMN `Last_referenced` `c11` INT NOT NULL default 99' + ), + }, +); + +is( + $exit_status, + 0, + "--alter rename columns with uppercase names -> exit status 0", +); + +my $structure = $master_dbh->selectall_arrayref('DESCRIBE test.t1'); +is_deeply( + $structure->[2], + [ + 'c11', + 'int(11)', + 'NO', + 'MUL', + '99', + '' + ], + '--alter rename columns with uppercase names -> Column was renamed' +); + +my $new_rows = $master_dbh->selectall_arrayref('SELECT * FROM test.t1'); + +is_deeply( + $ori_rows, + $new_rows, + "--alter rename columns with uppercase names -> Row values OK" + ); + + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/pt-196.t b/t/pt-online-schema-change/pt-196.t new file mode 100644 index 00000000..9e9e4172 --- /dev/null +++ b/t/pt-online-schema-change/pt-196.t @@ -0,0 +1,65 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 2; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-196.sql"); + + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=test", + '--execute', '--alter', 'DROP COLUMN test', ), + }, +); + +is( + $exit_status, + 0, + "--alter rename columns with uppercase names -> exit status 0", +); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/pt-200.t b/t/pt-online-schema-change/pt-200.t new file mode 100644 index 00000000..5670146f --- /dev/null +++ b/t/pt-online-schema-change/pt-200.t @@ -0,0 +1,72 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 3; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-153.sql"); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', + '--alter', "ADD COLUMN unique_id BIGINT UNSIGNED NOT NULL DEFAULT 0, ADD INDEX(unique_id)", + ), + }, +); + +is( + $exit_status, + 0, + "PT-200 Adding a column named unique_xxx is not detected as an unique index", +); + +like( + $output, + qr/Successfully altered `test`.`t1`/s, + "PT-200 Adding field having 'unique' in the name", +); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/pt-202.t b/t/pt-online-schema-change/pt-202.t new file mode 100644 index 00000000..d02643fd --- /dev/null +++ b/t/pt-online-schema-change/pt-202.t @@ -0,0 +1,76 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +if ($sandbox_version lt '5.7') { + plan skip_all => "generated column tests require MySQL 5.7+"; +} + +plan tests => 3; + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the +# tool will die. +my @args = (qw(--set-vars innodb_lock_wait_timeout=3)); +my $output; +my $exit_status; +my $sample = "t/pt-online-schema-change/samples/"; + +$sb->load_file('master', "$sample/pt-202.sql"); + +($output, $exit_status) = full_output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=t1", + '--execute', + '--alter', "ADD COLUMN `Column4` VARCHAR(45) NULL AFTER `Column3`", + ), + }, +); + +is( + $exit_status, + 0, + "PT-202 Altering table having generated columns exit status 0", +); + +like( + $output, + qr/Successfully altered `test`.`t1`/s, + "PT-202 Altering table having generated columns success", +); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-online-schema-change/samples/after_triggers.sql b/t/pt-online-schema-change/samples/after_triggers.sql new file mode 100644 index 00000000..4ec37075 --- /dev/null +++ b/t/pt-online-schema-change/samples/after_triggers.sql @@ -0,0 +1,77 @@ +DROP SCHEMA IF EXISTS test; +CREATE SCHEMA test; + +CREATE TABLE test.t1 ( + id INT NOT NULL AUTO_INCREMENT, + f1 INT, + f2 VARCHAR(32), + PRIMARY KEY (id) +); + +CREATE TABLE test.t2 LIKE test.t1; + +CREATE TABLE test.log ( + ts TIMESTAMP, + msg VARCHAR(255) +); + + +DROP TRIGGER IF EXISTS test.after_insert; +DROP TRIGGER IF EXISTS test.after_update; +DROP TRIGGER IF EXISTS test.after_delete; + + +CREATE TRIGGER test.after_insert + AFTER + -- a comment here + INSERT ON test.t1 + -- just to make things harder + FOR EACH ROW INSERT INTO test.log VALUES (NOW(), CONCAT("inserted new row with id: ", NEW.id)) + -- for pt_osc +; + +CREATE TRIGGER test.after_insert2 + AFTER + -- a comment here + INSERT ON test.t1 + -- just to make things harder + FOR EACH ROW INSERT INTO test.log VALUES (NOW(), CONCAT("inserted duplicate of new row with id: ", NEW.id)) + -- for pt_osc +; + +DELIMITER // + +CREATE TRIGGER test.after_update + AFTER + -- a comment here + UPDATE ON test.t1 + -- just to make things harder + FOR EACH ROW + BEGIN + INSERT INTO test.log VALUES (NOW(), CONCAT("updated row row with id ", OLD.id, " old f1:", OLD.f1, " new f1: ", NEW.f1 )); + INSERT INTO test.log VALUES (NOW(), CONCAT("updated row row with id ", OLD.id, " old f1:", OLD.f1, " new f1: ", NEW.f1 )); + END + -- for pt_osc +// + +DELIMITER ; + +CREATE TRIGGER test.after_delete + AFTER + -- a comment here + DELETE ON test.t1 + -- just to make things harder + FOR EACH ROW INSERT INTO test.log VALUES (NOW(), CONCAT("deleted row with id: ", OLD.id)) + -- for pt_osc +; + + +INSERT INTO test.t1 VALUES +(1, 1, 'a'), (2, 1, 'b'), (3, 1, 'c'), (4, 1, 'd'), +(5, 2, 'e'), (6, 2, 'f'), (7, 3, 'h'), (8, 3, 'g'); + +DELETE FROM test.t1 WHERE f2 = 'h'; +UPDATE test.t1 + SET f1 = f1 + 1 + WHERE f2 = 'g'; + diff --git a/t/pt-online-schema-change/samples/long_fk_constraints.sql b/t/pt-online-schema-change/samples/long_fk_constraints.sql new file mode 100644 index 00000000..cbc5811d --- /dev/null +++ b/t/pt-online-schema-change/samples/long_fk_constraints.sql @@ -0,0 +1,28 @@ +/* ----- Create two test tables with FKs for scenario 1 and 2: ----- */ +drop database if exists bug1215587; +CREATE DATABASE bug1215587; +USE bug1215587; + +CREATE TABLE IF NOT EXISTS `Table1` ( + `ID` int unsigned NOT NULL AUTO_INCREMENT, + `T2ID` smallint unsigned DEFAULT NULL, + PRIMARY KEY (`ID`), + KEY `tagIndex` (`T2ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `Table2` ( + `ID` smallint unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +ALTER TABLE `Table1` + ADD CONSTRAINT `_fkey1a` FOREIGN KEY (`T2ID`) REFERENCES `Table2` (`ID`) ON DELETE NO ACTION; + +ALTER TABLE `Table1` + ADD CONSTRAINT `_fkey_SALES_RECURRING_PROFILE_CUSTOMER_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`T2ID`) REFERENCES `Table2` (`ID`) ON DELETE NO ACTION; + +ALTER TABLE `Table2` + ADD CONSTRAINT `fkey2a` FOREIGN KEY (`ID`) REFERENCES `Table1` (`T2ID`) ON DELETE NO ACTION; + +ALTER TABLE `Table2` + ADD CONSTRAINT `_fkey2b` FOREIGN KEY (`ID`) REFERENCES `Table1` (`T2ID`) ON DELETE NO ACTION; diff --git a/t/pt-online-schema-change/samples/pt-116.sql b/t/pt-online-schema-change/samples/pt-116.sql deleted file mode 100644 index 1843266f..00000000 --- a/t/pt-online-schema-change/samples/pt-116.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE SCHEMA IF NOT EXISTS test; - -DROP TABLE IF EXISTS test.t1; - -CREATE TABLE test.t1 ( - id TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - notunique VARCHAR(200) NOT NULL -); - -INSERT INTO test.t1(notunique) VALUES('test01'),('test01'),('test02'); diff --git a/t/pt-online-schema-change/samples/pt-153.sql b/t/pt-online-schema-change/samples/pt-153.sql new file mode 100644 index 00000000..47b50354 --- /dev/null +++ b/t/pt-online-schema-change/samples/pt-153.sql @@ -0,0 +1,19 @@ +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; +USE test; +CREATE TABLE test.t1 ( +id int, +f2 int, +f3 int NULL, +f4 int, +PRIMARY KEY (id) +); + +INSERT INTO test.t1 VALUES +(1,1,1,1), +(2,1,1,1), +(3,1,2,1), +(4,2,NULL,2), +(5,3,NULL,2), +(6,4,4,4), +(7,4,4,4); diff --git a/t/pt-online-schema-change/samples/pt-186.sql b/t/pt-online-schema-change/samples/pt-186.sql new file mode 100644 index 00000000..2c6124cc --- /dev/null +++ b/t/pt-online-schema-change/samples/pt-186.sql @@ -0,0 +1,33 @@ +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; + +CREATE TABLE `test`.`t1` ( + `c1` int(10) unsigned NOT NULL, + `c2` varchar(255) NOT NULL, + `Last_referenced` INT NOT NULL DEFAULT 0, + `c3` int(10) unsigned NOT NULL, + `c4` int(10) unsigned NOT NULL DEFAULT '0', + `c5` varchar(255) NOT NULL DEFAULT '', + `c6` varchar(255) NOT NULL DEFAULT '', + `c7` varchar(255) NOT NULL DEFAULT '', + `c8` varchar(255) DEFAULT '', + `c9` varchar(255) DEFAULT '', + `c10` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`c1`,`c2`), + KEY `Last_Referenced_c6_Index` (`Last_referenced`,`c6`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO `test`.`t1` VALUES + (1,'',0,139772,47473,'','','','','',178332), + (2,'',1,74283,65463,'','','','','',159673), + (3,'',2,161929,72681,'','','','','',189530), + (4,'',3,76402,136494,'','','','','',132035), + (5,'',4,133053,176778,'','','','','',198267), + (6,'',5,68824,198479,'','','','','',139027), + (7,'',6,98103,195314,'','','','','',307), + (8,'',7,15094,53330,'','','','','',26258), + (9,'',8,183263,73658,'','','','','',51367), +(10,'',9,141835,87261,'','','','','',73928); + + + diff --git a/t/pt-online-schema-change/samples/pt-196.sql b/t/pt-online-schema-change/samples/pt-196.sql new file mode 100644 index 00000000..bf3dbefd --- /dev/null +++ b/t/pt-online-schema-change/samples/pt-196.sql @@ -0,0 +1,10 @@ +DROP SCHEMA IF EXISTS test; +CREATE SCHEMA test; +USE test; + +CREATE TABLE test( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + test INT +); + +INSERT INTO test (test) VALUES(1),(2),(3); diff --git a/t/pt-online-schema-change/samples/pt-202.sql b/t/pt-online-schema-change/samples/pt-202.sql new file mode 100644 index 00000000..721780d2 --- /dev/null +++ b/t/pt-online-schema-change/samples/pt-202.sql @@ -0,0 +1,9 @@ +CREATE SCHEMA IF NOT EXISTS test; +USE test; +DROP TABLE IF EXISTS t1; +CREATE TABLE `test`.`t1` ( +`ID` int(11) NOT NULL, +`Column2` int(11) DEFAULT NULL, +`Column3` int(11) GENERATED ALWAYS AS ((`Column2` + 1)) STORED, +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/t/pt-online-schema-change/samples/slave_lag.sql b/t/pt-online-schema-change/samples/slave_lag.sql new file mode 100644 index 00000000..55ab2a8a --- /dev/null +++ b/t/pt-online-schema-change/samples/slave_lag.sql @@ -0,0 +1,99 @@ +-- MySQL dump 10.13 Distrib 5.7.19, for Linux (x86_64) +-- +-- Host: 127.1 Database: test +-- ------------------------------------------------------ +-- Server version 5.6.36-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `pt178` +-- + +DROP DATABASE IF EXISTS test; +CREATE DATABASE test; +USE test; + +DROP TABLE IF EXISTS `test`.`pt178_dummy`; + +CREATE TABLE `pt178_dummy` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + f1 VARCHAR(30) NULL, + f2 BIGINT(11) DEFAULT 0, + PRIMARY KEY(id) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS `pt178`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pt178` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + f1 VARCHAR(30) DEFAULT '', + f2 BIGINT(11) DEFAULT 0, + PRIMARY KEY(id) +) ENGINE=InnoDB; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pt178` +-- + +LOCK TABLES `pt178` WRITE; +/*!40000 ALTER TABLE `pt178` DISABLE KEYS */; +INSERT INTO `pt178` (id) VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),(41),(42),(43),(44),(45),(46),(47),(48),(49); + +INSERT INTO `pt178` (id) VALUES +(50),(51),(52),(53),(54),(55),(56),(57),(58),(59),(60),(61),(62),(63),(64),(65),(66),(67),(68),(69),(70),(71),(72),(73),(74),(75),(76),(77),(78),(79),(80),(81),(82),(83),(84),(85),(86),(87),(88),(89),(90),(91),(92),(93),(94),(95),(96),(97),(98),(99),(100),(101),(102),(103),(104),(105),(106),(107),(108),(109),(110),(111),(112),(113),(114),(115),(116),(117),(118),(119),(120),(121),(122),(123),(124),(125),(126),(127),(128),(129),(130),(131),(132),(133),(134),(135),(136),(137),(138),(139),(140),(141),(142),(143),(144),(145),(146),(147),(148),(149),(150),(151),(152),(153),(154),(155),(156),(157),(158),(159),(160),(161),(162),(163),(164),(165),(166),(167),(168),(169),(170),(171),(172),(173),(174),(175),(176),(177),(178),(179),(180),(181),(182),(183),(184),(185),(186),(187),(188),(189),(190),(191),(192),(193),(194),(195),(196),(197),(198),(199),(200),(201),(202),(203),(204),(205),(206),(207),(208),(209),(210),(211),(212),(213),(214),(215),(216),(217),(218),(219),(220),(221),(222),(223),(224),(225),(226),(227),(228),(229),(230),(231),(232),(233),(234),(235),(236),(237),(238),(239),(240),(241),(242),(243),(244),(245),(246),(247),(248),(249),(250),(251),(252),(253),(254),(255),(256),(257),(258),(259),(260),(261),(262),(263),(264),(265),(266),(267),(268),(269),(270),(271),(272),(273),(274),(275),(276),(277),(278),(279),(280),(281),(282),(283),(284),(285),(286),(287),(288),(289),(290),(291),(292),(293),(294),(295),(296),(297),(298),(299),(300),(301),(302),(303),(304),(305),(306),(307),(308),(309),(310),(311),(312),(313),(314),(315),(316),(317),(318),(319),(320),(321),(322),(323),(324),(325),(326),(327),(328),(329),(330),(331),(332),(333),(334),(335),(336),(337),(338),(339),(340),(341),(342),(343),(344),(345),(346),(347),(348),(349),(350),(351),(352),(353),(354),(355),(356),(357),(358),(359),(360),(361),(362),(363),(364),(365),(366),(367),(368),(369),(370),(371),(372),(373),(374),(375),(376),(377),(378),(379),(380),(381),(382),(383),(384),(385),(386),(387),(388),(389),(390),(391),(392),(393),(394),(395),(396),(397),(398),(399),(400),(401),(402),(403),(404),(405),(406),(407),(408),(409),(410),(411),(412),(413),(414),(415),(416),(417),(418),(419),(420),(421),(422),(423),(424),(425),(426),(427),(428),(429),(430),(431),(432),(433),(434),(435),(436),(437),(438),(439),(440),(441),(442),(443),(444),(445),(446),(447),(448),(449),(450),(451),(452),(453),(454),(455),(456),(457),(458),(459),(460),(461),(462),(463),(464),(465),(466),(467),(468),(469),(470),(471),(472),(473),(474),(475),(476),(477),(478),(479),(480),(481),(482),(483),(484),(485),(486),(487),(488),(489),(490),(491),(492),(493),(494),(495),(496),(497),(498),(499); + +INSERT INTO `pt178` (id) VALUES +(500),(501),(502),(503),(504),(505),(506),(507),(508),(509),(510),(511),(512),(513),(514),(515),(516),(517),(518),(519),(520),(521),(522),(523),(524),(525),(526),(527),(528),(529),(530),(531),(532),(533),(534),(535),(536),(537),(538),(539),(540),(541),(542),(543),(544),(545),(546),(547),(548),(549); + +INSERT INTO `pt178` (id) VALUES +(550),(551),(552),(553),(554),(555),(556),(557),(558),(559),(560),(561),(562),(563),(564),(565),(566),(567),(568),(569),(570),(571),(572),(573),(574),(575),(576),(577),(578),(579),(580),(581),(582),(583),(584),(585),(586),(587),(588),(589),(590),(591),(592),(593),(594),(595),(596),(597),(598),(599),(600),(601),(602),(603),(604),(605),(606),(607),(608),(609),(610),(611),(612),(613),(614),(615),(616),(617),(618),(619),(620),(621),(622),(623),(624),(625),(626),(627),(628),(629),(630),(631),(632),(633),(634),(635),(636),(637),(638),(639),(640),(641),(642),(643),(644),(645),(646),(647),(648),(649),(650),(651),(652),(653),(654),(655),(656),(657),(658),(659),(660),(661),(662),(663),(664),(665),(666),(667),(668),(669),(670),(671),(672),(673),(674),(675),(676),(677),(678),(679),(680),(681),(682),(683),(684),(685),(686),(687),(688),(689),(690),(691),(692),(693),(694),(695),(696),(697),(698),(699),(700),(701),(702),(703),(704),(705),(706),(707),(708),(709),(710),(711),(712),(713),(714),(715),(716),(717),(718),(719),(720),(721),(722),(723),(724),(725),(726),(727),(728),(729),(730),(731),(732),(733),(734),(735),(736),(737),(738),(739),(740),(741),(742),(743),(744),(745),(746),(747),(748),(749),(750),(751),(752),(753),(754),(755),(756),(757),(758),(759),(760),(761),(762),(763),(764),(765),(766),(767),(768),(769),(770),(771),(772),(773),(774),(775),(776),(777),(778),(779),(780),(781),(782),(783),(784),(785),(786),(787),(788),(789),(790),(791),(792),(793),(794),(795),(796),(797),(798),(799),(800),(801),(802),(803),(804),(805),(806),(807),(808),(809),(810),(811),(812),(813),(814),(815),(816),(817),(818),(819),(820),(821),(822),(823),(824),(825),(826),(827),(828),(829),(830),(831),(832),(833),(834),(835),(836),(837),(838),(839),(840),(841),(842),(843),(844),(845),(846),(847),(848),(849),(850),(851),(852),(853),(854),(855),(856),(857),(858),(859),(860),(861),(862),(863),(864),(865),(866),(867),(868),(869),(870),(871),(872),(873),(874),(875),(876),(877),(878),(879),(880),(881),(882),(883),(884),(885),(886),(887),(888),(889),(890),(891),(892),(893),(894),(895),(896),(897),(898),(899),(900),(901),(902),(903),(904),(905),(906),(907),(908),(909),(910),(911),(912),(913),(914),(915),(916),(917),(918),(919),(920),(921),(922),(923),(924),(925),(926),(927),(928),(929),(930),(931),(932),(933),(934),(935),(936),(937),(938),(939),(940),(941),(942),(943),(944),(945),(946),(947),(948),(949),(950),(951),(952),(953),(954),(955),(956),(957),(958),(959),(960),(961),(962),(963),(964),(965),(966),(967),(968),(969),(970),(971),(972),(973),(974),(975),(976),(977),(978),(979),(980),(981),(982),(983),(984),(985),(986),(987),(988),(989),(990),(991),(992),(993),(994),(995),(996),(997),(998),(999),(1000); + +INSERT INTO `pt178` (id) VALUES +(1001),(1002),(1003),(1004),(1005),(1006),(1007),(1008),(1009),(1010),(1011),(1012),(1013),(1014),(1015),(1016),(1017),(1018),(1019),(1020),(1021),(1022),(1023),(1024),(1025),(1026),(1027),(1028),(1029),(1030),(1031),(1032),(1033),(1034),(1035),(1036),(1037),(1038),(1039),(1040),(1041),(1042),(1043),(1044),(1045),(1046),(1047),(1048),(1049),(1050),(1051),(1052),(1053),(1054),(1055),(1056),(1057),(1058),(1059),(1060),(1061),(1062),(1063),(1064),(1065),(1066),(1067),(1068),(1069),(1070),(1071),(1072),(1073),(1074),(1075),(1076),(1077),(1078),(1079),(1080),(1081),(1082),(1083),(1084),(1085),(1086),(1087),(1088),(1089),(1090),(1091),(1092),(1093),(1094),(1095),(1096),(1097),(1098),(1099),(1100),(1101),(1102),(1103),(1104),(1105),(1106),(1107),(1108),(1109),(1110),(1111),(1112),(1113),(1114),(1115),(1116),(1117),(1118),(1119),(1120),(1121),(1122),(1123),(1124),(1125),(1126),(1127),(1128),(1129),(1130),(1131),(1132),(1133),(1134),(1135),(1136),(1137),(1138),(1139),(1140),(1141),(1142),(1143),(1144),(1145),(1146),(1147),(1148),(1149),(1150),(1151),(1152),(1153),(1154),(1155),(1156),(1157),(1158),(1159),(1160),(1161),(1162),(1163),(1164),(1165),(1166),(1167),(1168),(1169),(1170),(1171),(1172),(1173),(1174),(1175),(1176),(1177),(1178),(1179),(1180),(1181),(1182),(1183),(1184),(1185),(1186),(1187),(1188),(1189),(1190),(1191),(1192),(1193),(1194),(1195),(1196),(1197),(1198),(1199),(1200),(1201),(1202),(1203),(1204),(1205),(1206),(1207),(1208),(1209),(1210),(1211),(1212),(1213),(1214),(1215),(1216),(1217),(1218),(1219),(1220),(1221),(1222),(1223),(1224),(1225),(1226),(1227),(1228),(1229),(1230),(1231),(1232),(1233),(1234),(1235),(1236),(1237),(1238),(1239),(1240),(1241),(1242),(1243),(1244),(1245),(1246),(1247),(1248),(1249),(1250),(1251),(1252),(1253),(1254),(1255),(1256),(1257),(1258),(1259),(1260),(1261),(1262),(1263),(1264),(1265),(1266),(1267),(1268),(1269),(1270),(1271),(1272),(1273),(1274),(1275),(1276),(1277),(1278),(1279),(1280),(1281),(1282),(1283),(1284),(1285),(1286),(1287),(1288),(1289),(1290),(1291),(1292),(1293),(1294),(1295),(1296),(1297),(1298),(1299),(1300),(1301),(1302),(1303),(1304),(1305),(1306),(1307),(1308),(1309),(1310),(1311),(1312),(1313),(1314),(1315),(1316),(1317),(1318),(1319),(1320),(1321),(1322),(1323),(1324),(1325),(1326),(1327),(1328),(1329),(1330),(1331),(1332),(1333),(1334),(1335),(1336),(1337),(1338),(1339),(1340),(1341),(1342),(1343),(1344),(1345),(1346),(1347),(1348),(1349),(1350),(1351),(1352),(1353),(1354),(1355),(1356),(1357),(1358),(1359),(1360),(1361),(1362),(1363),(1364),(1365),(1366),(1367),(1368),(1369),(1370),(1371),(1372),(1373),(1374),(1375),(1376),(1377),(1378),(1379),(1380),(1381),(1382),(1383),(1384),(1385),(1386),(1387),(1388),(1389),(1390),(1391),(1392),(1393),(1394),(1395),(1396),(1397),(1398),(1399),(1400),(1401),(1402),(1403),(1404),(1405),(1406),(1407),(1408),(1409),(1410),(1411),(1412),(1413),(1414),(1415),(1416),(1417),(1418),(1419),(1420),(1421),(1422),(1423),(1424),(1425),(1426),(1427),(1428),(1429),(1430),(1431),(1432),(1433),(1434),(1435),(1436),(1437),(1438),(1439),(1440),(1441),(1442),(1443),(1444),(1445),(1446),(1447),(1448),(1449),(1450),(1451),(1452),(1453),(1454),(1455),(1456),(1457),(1458),(1459),(1460),(1461),(1462),(1463),(1464),(1465),(1466),(1467),(1468),(1469),(1470),(1471),(1472),(1473),(1474),(1475),(1476),(1477),(1478),(1479),(1480),(1481),(1482),(1483),(1484),(1485),(1486),(1487),(1488),(1489),(1490),(1491),(1492),(1493),(1494),(1495),(1496),(1497),(1498),(1499); + +INSERT INTO `pt178` (id) VALUES +(1500),(1501),(1502),(1503),(1504),(1505),(1506),(1507),(1508),(1509),(1510),(1511),(1512),(1513),(1514),(1515),(1516),(1517),(1518),(1519),(1520),(1521),(1522),(1523),(1524),(1525),(1526),(1527),(1528),(1529),(1530),(1531),(1532),(1533),(1534),(1535),(1536),(1537),(1538),(1539),(1540),(1541),(1542),(1543),(1544),(1545),(1546),(1547),(1548),(1549),(1550),(1551),(1552),(1553),(1554),(1555),(1556),(1557),(1558),(1559),(1560),(1561),(1562),(1563),(1564),(1565),(1566),(1567),(1568),(1569),(1570),(1571),(1572),(1573),(1574),(1575),(1576),(1577),(1578),(1579),(1580),(1581),(1582),(1583),(1584),(1585),(1586),(1587),(1588),(1589),(1590),(1591),(1592),(1593),(1594),(1595),(1596),(1597),(1598),(1599),(1600),(1601),(1602),(1603),(1604),(1605),(1606),(1607),(1608),(1609),(1610),(1611),(1612),(1613),(1614),(1615),(1616),(1617),(1618),(1619),(1620),(1621),(1622),(1623),(1624),(1625),(1626),(1627),(1628),(1629),(1630),(1631),(1632),(1633),(1634),(1635),(1636),(1637),(1638),(1639),(1640),(1641),(1642),(1643),(1644),(1645),(1646),(1647),(1648),(1649),(1650),(1651),(1652),(1653),(1654),(1655),(1656),(1657),(1658),(1659),(1660),(1661),(1662),(1663),(1664),(1665),(1666),(1667),(1668),(1669),(1670),(1671),(1672),(1673),(1674),(1675),(1676),(1677),(1678),(1679),(1680),(1681),(1682),(1683),(1684),(1685),(1686),(1687),(1688),(1689),(1690),(1691),(1692),(1693),(1694),(1695),(1696),(1697),(1698),(1699),(1700),(1701),(1702),(1703),(1704),(1705),(1706),(1707),(1708),(1709),(1710),(1711),(1712),(1713),(1714),(1715),(1716),(1717),(1718),(1719),(1720),(1721),(1722),(1723),(1724),(1725),(1726),(1727),(1728),(1729),(1730),(1731),(1732),(1733),(1734),(1735),(1736),(1737),(1738),(1739),(1740),(1741),(1742),(1743),(1744),(1745),(1746),(1747),(1748),(1749),(1750),(1751),(1752),(1753),(1754),(1755),(1756),(1757),(1758),(1759),(1760),(1761),(1762),(1763),(1764),(1765),(1766),(1767),(1768),(1769),(1770),(1771),(1772),(1773),(1774),(1775),(1776),(1777),(1778),(1779),(1780),(1781),(1782),(1783),(1784),(1785),(1786),(1787),(1788),(1789),(1790),(1791),(1792),(1793),(1794),(1795),(1796),(1797),(1798),(1799),(1800),(1801),(1802),(1803),(1804),(1805),(1806),(1807),(1808),(1809),(1810),(1811),(1812),(1813),(1814),(1815),(1816),(1817),(1818),(1819),(1820),(1821),(1822),(1823),(1824),(1825),(1826),(1827),(1828),(1829),(1830),(1831),(1832),(1833),(1834),(1835),(1836),(1837),(1838),(1839),(1840),(1841),(1842),(1843),(1844),(1845),(1846),(1847),(1848),(1849),(1850),(1851),(1852),(1853),(1854),(1855),(1856),(1857),(1858),(1859),(1860),(1861),(1862),(1863),(1864),(1865),(1866),(1867),(1868),(1869),(1870),(1871),(1872),(1873),(1874),(1875),(1876),(1877),(1878),(1879),(1880),(1881),(1882),(1883),(1884),(1885),(1886),(1887),(1888),(1889),(1890),(1891),(1892),(1893),(1894),(1895),(1896),(1897),(1898),(1899),(1900),(1901),(1902),(1903),(1904),(1905),(1906),(1907),(1908),(1909),(1910),(1911),(1912),(1913),(1914),(1915),(1916),(1917),(1918),(1919),(1920),(1921),(1922),(1923),(1924),(1925),(1926),(1927),(1928),(1929),(1930),(1931),(1932),(1933),(1934),(1935),(1936),(1937),(1938),(1939),(1940),(1941),(1942),(1943),(1944),(1945),(1946),(1947),(1948),(1949),(1950),(1951),(1952),(1953),(1954),(1955),(1956),(1957),(1958),(1959),(1960),(1961),(1962),(1963),(1964),(1965),(1966),(1967),(1968),(1969),(1970),(1971),(1972),(1973),(1974),(1975),(1976),(1977),(1978),(1979),(1980),(1981),(1982),(1983),(1984),(1985),(1986),(1987),(1988),(1989),(1990),(1991),(1992),(1993),(1994),(1995),(1996),(1997),(1998),(1999); + +INSERT INTO `pt178` (id) VALUES +(2000),(2001),(2002),(2003),(2004),(2005),(2006),(2007),(2008),(2009),(2010),(2011),(2012),(2013),(2014),(2015),(2016),(2017),(2018),(2019),(2020),(2021),(2022),(2023),(2024),(2025),(2026),(2027),(2028),(2029),(2030),(2031),(2032),(2033),(2034),(2035),(2036),(2037),(2038),(2039),(2040),(2041),(2042),(2043),(2044),(2045),(2046),(2047),(2048),(2049),(2050),(2051),(2052),(2053),(2054),(2055),(2056),(2057),(2058),(2059),(2060),(2061),(2062),(2063),(2064),(2065),(2066),(2067),(2068),(2069),(2070),(2071),(2072),(2073),(2074),(2075),(2076),(2077),(2078),(2079),(2080),(2081),(2082),(2083),(2084),(2085),(2086),(2087),(2088),(2089),(2090),(2091),(2092),(2093),(2094),(2095),(2096),(2097),(2098),(2099),(2100),(2101),(2102),(2103),(2104),(2105),(2106),(2107),(2108),(2109),(2110),(2111),(2112),(2113),(2114),(2115),(2116),(2117),(2118),(2119),(2120),(2121),(2122),(2123),(2124),(2125),(2126),(2127),(2128),(2129),(2130),(2131),(2132),(2133),(2134),(2135),(2136),(2137),(2138),(2139),(2140),(2141),(2142),(2143),(2144),(2145),(2146),(2147),(2148),(2149),(2150),(2151),(2152),(2153),(2154),(2155),(2156),(2157),(2158),(2159),(2160),(2161),(2162),(2163),(2164),(2165),(2166),(2167),(2168),(2169),(2170),(2171),(2172),(2173),(2174),(2175),(2176),(2177),(2178),(2179),(2180),(2181),(2182),(2183),(2184),(2185),(2186),(2187),(2188),(2189),(2190),(2191),(2192),(2193),(2194),(2195),(2196),(2197),(2198),(2199),(2200),(2201),(2202),(2203),(2204),(2205),(2206),(2207),(2208),(2209),(2210),(2211),(2212),(2213),(2214),(2215),(2216),(2217),(2218),(2219),(2220),(2221),(2222),(2223),(2224),(2225),(2226),(2227),(2228),(2229),(2230),(2231),(2232),(2233),(2234),(2235),(2236),(2237),(2238),(2239),(2240),(2241),(2242),(2243),(2244),(2245),(2246),(2247),(2248),(2249),(2250),(2251),(2252),(2253),(2254),(2255),(2256),(2257),(2258),(2259),(2260),(2261),(2262),(2263),(2264),(2265),(2266),(2267),(2268),(2269),(2270),(2271),(2272),(2273),(2274),(2275),(2276),(2277),(2278),(2279),(2280),(2281),(2282),(2283),(2284),(2285),(2286),(2287),(2288),(2289),(2290),(2291),(2292),(2293),(2294),(2295),(2296),(2297),(2298),(2299),(2300),(2301),(2302),(2303),(2304),(2305),(2306),(2307),(2308),(2309),(2310),(2311),(2312),(2313),(2314),(2315),(2316),(2317),(2318),(2319),(2320),(2321),(2322),(2323),(2324),(2325),(2326),(2327),(2328),(2329),(2330),(2331),(2332),(2333),(2334),(2335),(2336),(2337),(2338),(2339),(2340),(2341),(2342),(2343),(2344),(2345),(2346),(2347),(2348),(2349),(2350),(2351),(2352),(2353),(2354),(2355),(2356),(2357),(2358),(2359),(2360),(2361),(2362),(2363),(2364),(2365),(2366),(2367),(2368),(2369),(2370),(2371),(2372),(2373),(2374),(2375),(2376),(2377),(2378),(2379),(2380),(2381),(2382),(2383),(2384),(2385),(2386),(2387),(2388),(2389),(2390),(2391),(2392),(2393),(2394),(2395),(2396),(2397),(2398),(2399),(2400),(2401),(2402),(2403),(2404),(2405),(2406),(2407),(2408),(2409),(2410),(2411),(2412),(2413),(2414),(2415),(2416),(2417),(2418),(2419),(2420),(2421),(2422),(2423),(2424),(2425),(2426),(2427),(2428),(2429),(2430),(2431),(2432),(2433),(2434),(2435),(2436),(2437),(2438),(2439),(2440),(2441),(2442),(2443),(2444),(2445),(2446),(2447),(2448),(2449),(2450),(2451),(2452),(2453),(2454),(2455),(2456),(2457),(2458),(2459),(2460),(2461),(2462),(2463),(2464),(2465),(2466),(2467),(2468),(2469),(2470),(2471),(2472),(2473),(2474),(2475),(2476),(2477),(2478),(2479),(2480),(2481),(2482),(2483),(2484),(2485),(2486),(2487),(2488),(2489),(2490),(2491),(2492),(2493),(2494),(2495),(2496),(2497),(2498),(2499); + +INSERT INTO `pt178` (id) VALUES +(2500),(2501),(2502),(2503),(2504),(2505),(2506),(2507),(2508),(2509),(2510),(2511),(2512),(2513),(2514),(2515),(2516),(2517),(2518),(2519),(2520),(2521),(2522),(2523),(2524),(2525),(2526),(2527),(2528),(2529),(2530),(2531),(2532),(2533),(2534),(2535),(2536),(2537),(2538),(2539),(2540),(2541),(2542),(2543),(2544),(2545),(2546),(2547),(2548),(2549),(2550),(2551),(2552),(2553),(2554),(2555),(2556),(2557),(2558),(2559),(2560),(2561),(2562),(2563),(2564),(2565),(2566),(2567),(2568),(2569),(2570),(2571),(2572),(2573),(2574),(2575),(2576),(2577),(2578),(2579),(2580),(2581),(2582),(2583),(2584),(2585),(2586),(2587),(2588),(2589),(2590),(2591),(2592),(2593),(2594),(2595),(2596),(2597),(2598),(2599),(2600),(2601),(2602),(2603),(2604),(2605),(2606),(2607),(2608),(2609),(2610),(2611),(2612),(2613),(2614),(2615),(2616),(2617),(2618),(2619),(2620),(2621),(2622),(2623),(2624),(2625),(2626),(2627),(2628),(2629),(2630),(2631),(2632),(2633),(2634),(2635),(2636),(2637),(2638),(2639),(2640),(2641),(2642),(2643),(2644),(2645),(2646),(2647),(2648),(2649),(2650),(2651),(2652),(2653),(2654),(2655),(2656),(2657),(2658),(2659),(2660),(2661),(2662),(2663),(2664),(2665),(2666),(2667),(2668),(2669),(2670),(2671),(2672),(2673),(2674),(2675),(2676),(2677),(2678),(2679),(2680),(2681),(2682),(2683),(2684),(2685),(2686),(2687),(2688),(2689),(2690),(2691),(2692),(2693),(2694),(2695),(2696),(2697),(2698),(2699),(2700),(2701),(2702),(2703),(2704),(2705),(2706),(2707),(2708),(2709),(2710),(2711),(2712),(2713),(2714),(2715),(2716),(2717),(2718),(2719),(2720),(2721),(2722),(2723),(2724),(2725),(2726),(2727),(2728),(2729),(2730),(2731),(2732),(2733),(2734),(2735),(2736),(2737),(2738),(2739),(2740),(2741),(2742),(2743),(2744),(2745),(2746),(2747),(2748),(2749),(2750),(2751),(2752),(2753),(2754),(2755),(2756),(2757),(2758),(2759),(2760),(2761),(2762),(2763),(2764),(2765),(2766),(2767),(2768),(2769),(2770),(2771),(2772),(2773),(2774),(2775),(2776),(2777),(2778),(2779),(2780),(2781),(2782),(2783),(2784),(2785),(2786),(2787),(2788),(2789),(2790),(2791),(2792),(2793),(2794),(2795),(2796),(2797),(2798),(2799),(2800),(2801),(2802),(2803),(2804),(2805),(2806),(2807),(2808),(2809),(2810),(2811),(2812),(2813),(2814),(2815),(2816),(2817),(2818),(2819),(2820),(2821),(2822),(2823),(2824),(2825),(2826),(2827),(2828),(2829),(2830),(2831),(2832),(2833),(2834),(2835),(2836),(2837),(2838),(2839),(2840),(2841),(2842),(2843),(2844),(2845),(2846),(2847),(2848),(2849),(2850),(2851),(2852),(2853),(2854),(2855),(2856),(2857),(2858),(2859),(2860),(2861),(2862),(2863),(2864),(2865),(2866),(2867),(2868),(2869),(2870),(2871),(2872),(2873),(2874),(2875),(2876),(2877),(2878),(2879),(2880),(2881),(2882),(2883),(2884),(2885),(2886),(2887),(2888),(2889),(2890),(2891),(2892),(2893),(2894),(2895),(2896),(2897),(2898),(2899),(2900),(2901),(2902),(2903),(2904),(2905),(2906),(2907),(2908),(2909),(2910),(2911),(2912),(2913),(2914),(2915),(2916),(2917),(2918),(2919),(2920),(2921),(2922),(2923),(2924),(2925),(2926),(2927),(2928),(2929),(2930),(2931),(2932),(2933),(2934),(2935),(2936),(2937),(2938),(2939),(2940),(2941),(2942),(2943),(2944),(2945),(2946),(2947),(2948),(2949),(2950),(2951),(2952),(2953),(2954),(2955),(2956),(2957),(2958),(2959),(2960),(2961),(2962),(2963),(2964),(2965),(2966),(2967),(2968),(2969),(2970),(2971),(2972),(2973),(2974),(2975),(2976),(2977),(2978),(2979),(2980),(2981),(2982),(2983),(2984),(2985),(2986),(2987),(2988),(2989),(2990),(2991),(2992),(2993),(2994),(2995),(2996),(2997),(2998),(2999); + +INSERT INTO `pt178` (id) VALUES +(3000),(3001),(3002),(3003),(3004),(3005),(3006),(3007),(3008),(3009),(3010),(3011),(3012),(3013),(3014),(3015),(3016),(3017),(3018),(3019),(3020),(3021),(3022),(3023),(3024),(3025),(3026),(3027),(3028),(3029),(3030),(3031),(3032),(3033),(3034),(3035),(3036),(3037),(3038),(3039),(3040),(3041),(3042),(3043),(3044),(3045),(3046),(3047),(3048),(3049),(3050),(3051),(3052),(3053),(3054),(3055),(3056),(3057),(3058),(3059),(3060),(3061),(3062),(3063),(3064),(3065),(3066),(3067),(3068),(3069),(3070),(3071),(3072),(3073),(3074),(3075),(3076),(3077),(3078),(3079),(3080),(3081),(3082),(3083),(3084),(3085),(3086),(3087),(3088),(3089),(3090),(3091),(3092),(3093),(3094),(3095),(3096),(3097),(3098),(3099),(3100),(3101),(3102),(3103),(3104),(3105),(3106),(3107),(3108),(3109),(3110),(3111),(3112),(3113),(3114),(3115),(3116),(3117),(3118),(3119),(3120),(3121),(3122),(3123),(3124),(3125),(3126),(3127),(3128),(3129),(3130),(3131),(3132),(3133),(3134),(3135),(3136),(3137),(3138),(3139),(3140),(3141),(3142),(3143),(3144),(3145),(3146),(3147),(3148),(3149),(3150),(3151),(3152),(3153),(3154),(3155),(3156),(3157),(3158),(3159),(3160),(3161),(3162),(3163),(3164),(3165),(3166),(3167),(3168),(3169),(3170),(3171),(3172),(3173),(3174),(3175),(3176),(3177),(3178),(3179),(3180),(3181),(3182),(3183),(3184),(3185),(3186),(3187),(3188),(3189),(3190),(3191),(3192),(3193),(3194),(3195),(3196),(3197),(3198),(3199),(3200),(3201),(3202),(3203),(3204),(3205),(3206),(3207),(3208),(3209),(3210),(3211),(3212),(3213),(3214),(3215),(3216),(3217),(3218),(3219),(3220),(3221),(3222),(3223),(3224),(3225),(3226),(3227),(3228),(3229),(3230),(3231),(3232),(3233),(3234),(3235),(3236),(3237),(3238),(3239),(3240),(3241),(3242),(3243),(3244),(3245),(3246),(3247),(3248),(3249),(3250),(3251),(3252),(3253),(3254),(3255),(3256),(3257),(3258),(3259),(3260),(3261),(3262),(3263),(3264),(3265),(3266),(3267),(3268),(3269),(3270),(3271),(3272),(3273),(3274),(3275),(3276),(3277),(3278),(3279),(3280),(3281),(3282),(3283),(3284),(3285),(3286),(3287),(3288),(3289),(3290),(3291),(3292),(3293),(3294),(3295),(3296),(3297),(3298),(3299),(3300),(3301),(3302),(3303),(3304),(3305),(3306),(3307),(3308),(3309),(3310),(3311),(3312),(3313),(3314),(3315),(3316),(3317),(3318),(3319),(3320),(3321),(3322),(3323),(3324),(3325),(3326),(3327),(3328),(3329),(3330),(3331),(3332),(3333),(3334),(3335),(3336),(3337),(3338),(3339),(3340),(3341),(3342),(3343),(3344),(3345),(3346),(3347),(3348),(3349),(3350),(3351),(3352),(3353),(3354),(3355),(3356),(3357),(3358),(3359),(3360),(3361),(3362),(3363),(3364),(3365),(3366),(3367),(3368),(3369),(3370),(3371),(3372),(3373),(3374),(3375),(3376),(3377),(3378),(3379),(3380),(3381),(3382),(3383),(3384),(3385),(3386),(3387),(3388),(3389),(3390),(3391),(3392),(3393),(3394),(3395),(3396),(3397),(3398),(3399),(3400),(3401),(3402),(3403),(3404),(3405),(3406),(3407),(3408),(3409),(3410),(3411),(3412),(3413),(3414),(3415),(3416),(3417),(3418),(3419),(3420),(3421),(3422),(3423),(3424),(3425),(3426),(3427),(3428),(3429),(3430),(3431),(3432),(3433),(3434),(3435),(3436),(3437),(3438),(3439),(3440),(3441),(3442),(3443),(3444),(3445),(3446),(3447),(3448),(3449),(3450),(3451),(3452),(3453),(3454),(3455),(3456),(3457),(3458),(3459),(3460),(3461),(3462),(3463),(3464),(3465),(3466),(3467),(3468),(3469),(3470),(3471),(3472),(3473),(3474),(3475),(3476),(3477),(3478),(3479),(3480),(3481),(3482),(3483),(3484),(3485),(3486),(3487),(3488),(3489),(3490),(3491),(3492),(3493),(3494),(3495),(3496),(3497),(3498),(3499),(3500),(3501),(3502),(3503),(3504),(3505),(3506),(3507),(3508),(3509),(3510),(3511),(3512),(3513),(3514),(3515),(3516),(3517),(3518),(3519),(3520),(3521),(3522),(3523),(3524),(3525),(3526),(3527),(3528),(3529),(3530),(3531),(3532),(3533),(3534),(3535),(3536),(3537),(3538),(3539),(3540),(3541),(3542),(3543),(3544),(3545),(3546),(3547),(3548),(3549),(3550),(3551),(3552),(3553),(3554),(3555),(3556),(3557),(3558),(3559),(3560),(3561),(3562),(3563),(3564),(3565),(3566),(3567),(3568),(3569),(3570),(3571),(3572),(3573),(3574),(3575),(3576),(3577),(3578),(3579),(3580),(3581),(3582),(3583),(3584),(3585),(3586),(3587),(3588),(3589),(3590),(3591),(3592),(3593),(3594),(3595),(3596),(3597),(3598),(3599),(3600),(3601),(3602),(3603),(3604),(3605),(3606),(3607),(3608),(3609),(3610),(3611),(3612),(3613),(3614),(3615),(3616),(3617),(3618),(3619),(3620),(3621),(3622),(3623),(3624),(3625),(3626),(3627),(3628),(3629),(3630),(3631),(3632),(3633),(3634),(3635),(3636),(3637),(3638),(3639),(3640),(3641),(3642),(3643),(3644),(3645),(3646),(3647),(3648),(3649),(3650),(3651),(3652),(3653),(3654),(3655),(3656),(3657),(3658),(3659),(3660),(3661),(3662),(3663),(3664),(3665),(3666),(3667),(3668),(3669),(3670),(3671),(3672),(3673),(3674),(3675),(3676),(3677),(3678),(3679),(3680),(3681),(3682),(3683),(3684),(3685),(3686),(3687),(3688),(3689),(3690),(3691),(3692),(3693),(3694),(3695),(3696),(3697),(3698),(3699),(3700),(3701),(3702),(3703),(3704),(3705),(3706),(3707),(3708),(3709),(3710),(3711),(3712),(3713),(3714),(3715),(3716),(3717),(3718),(3719),(3720),(3721),(3722),(3723),(3724),(3725),(3726),(3727),(3728),(3729),(3730),(3731),(3732),(3733),(3734),(3735),(3736),(3737),(3738),(3739),(3740),(3741),(3742),(3743),(3744),(3745),(3746),(3747),(3748),(3749),(3750),(3751),(3752),(3753),(3754),(3755),(3756),(3757),(3758),(3759),(3760),(3761),(3762),(3763),(3764),(3765),(3766),(3767),(3768),(3769),(3770),(3771),(3772),(3773),(3774),(3775),(3776),(3777),(3778),(3779),(3780),(3781),(3782),(3783),(3784),(3785),(3786),(3787),(3788),(3789),(3790),(3791),(3792),(3793),(3794),(3795),(3796),(3797),(3798),(3799),(3800),(3801),(3802),(3803),(3804),(3805),(3806),(3807),(3808),(3809),(3810),(3811),(3812),(3813),(3814),(3815),(3816),(3817),(3818),(3819),(3820),(3821),(3822),(3823),(3824),(3825),(3826),(3827),(3828),(3829),(3830),(3831),(3832),(3833),(3834),(3835),(3836),(3837),(3838),(3839),(3840),(3841),(3842),(3843),(3844),(3845),(3846),(3847),(3848),(3849),(3850),(3851),(3852),(3853),(3854),(3855),(3856),(3857),(3858),(3859),(3860),(3861),(3862),(3863),(3864),(3865),(3866),(3867),(3868),(3869),(3870),(3871),(3872),(3873),(3874),(3875),(3876),(3877),(3878),(3879),(3880),(3881),(3882),(3883),(3884),(3885),(3886),(3887),(3888),(3889),(3890),(3891),(3892),(3893),(3894),(3895),(3896),(3897),(3898),(3899),(3900),(3901),(3902),(3903),(3904),(3905),(3906),(3907),(3908),(3909),(3910),(3911),(3912),(3913),(3914),(3915),(3916),(3917),(3918),(3919),(3920),(3921),(3922),(3923),(3924),(3925),(3926),(3927),(3928),(3929),(3930),(3931),(3932),(3933),(3934),(3935),(3936),(3937),(3938),(3939),(3940),(3941),(3942),(3943),(3944),(3945),(3946),(3947),(3948),(3949),(3950),(3951),(3952),(3953),(3954),(3955),(3956),(3957),(3958),(3959),(3960),(3961),(3962),(3963),(3964),(3965),(3966),(3967),(3968),(3969),(3970),(3971),(3972),(3973),(3974),(3975),(3976),(3977),(3978),(3979),(3980),(3981),(3982),(3983),(3984),(3985),(3986),(3987),(3988),(3989),(3990),(3991),(3992),(3993),(3994),(3995),(3996),(3997),(3998),(3999); +INSERT INTO `pt178` (id) VALUES +(4000),(4001),(4002),(4003),(4004),(4005),(4006),(4007),(4008),(4009),(4010),(4011),(4012),(4013),(4014),(4015),(4016),(4017),(4018),(4019),(4020),(4021),(4022),(4023),(4024),(4025),(4026),(4027),(4028),(4029),(4030),(4031),(4032),(4033),(4034),(4035),(4036),(4037),(4038),(4039),(4040),(4041),(4042),(4043),(4044),(4045),(4046),(4047),(4048),(4049),(4050),(4051),(4052),(4053),(4054),(4055),(4056),(4057),(4058),(4059),(4060),(4061),(4062),(4063),(4064),(4065),(4066),(4067),(4068),(4069),(4070),(4071),(4072),(4073),(4074),(4075),(4076),(4077),(4078),(4079),(4080),(4081),(4082),(4083),(4084),(4085),(4086),(4087),(4088),(4089),(4090),(4091),(4092),(4093),(4094),(4095),(4096),(4097),(4098),(4099),(4100),(4101),(4102),(4103),(4104),(4105),(4106),(4107),(4108),(4109),(4110),(4111),(4112),(4113),(4114),(4115),(4116),(4117),(4118),(4119),(4120),(4121),(4122),(4123),(4124),(4125),(4126),(4127),(4128),(4129),(4130),(4131),(4132),(4133),(4134),(4135),(4136),(4137),(4138),(4139),(4140),(4141),(4142),(4143),(4144),(4145),(4146),(4147),(4148),(4149),(4150),(4151),(4152),(4153),(4154),(4155),(4156),(4157),(4158),(4159),(4160),(4161),(4162),(4163),(4164),(4165),(4166),(4167),(4168),(4169),(4170),(4171),(4172),(4173),(4174),(4175),(4176),(4177),(4178),(4179),(4180),(4181),(4182),(4183),(4184),(4185),(4186),(4187),(4188),(4189),(4190),(4191),(4192),(4193),(4194),(4195),(4196),(4197),(4198),(4199),(4200),(4201),(4202),(4203),(4204),(4205),(4206),(4207),(4208),(4209),(4210),(4211),(4212),(4213),(4214),(4215),(4216),(4217),(4218),(4219),(4220),(4221),(4222),(4223),(4224),(4225),(4226),(4227),(4228),(4229),(4230),(4231),(4232),(4233),(4234),(4235),(4236),(4237),(4238),(4239),(4240),(4241),(4242),(4243),(4244),(4245),(4246),(4247),(4248),(4249),(4250),(4251),(4252),(4253),(4254),(4255),(4256),(4257),(4258),(4259),(4260),(4261),(4262),(4263),(4264),(4265),(4266),(4267),(4268),(4269),(4270),(4271),(4272),(4273),(4274),(4275),(4276),(4277),(4278),(4279),(4280),(4281),(4282),(4283),(4284),(4285),(4286),(4287),(4288),(4289),(4290),(4291),(4292),(4293),(4294),(4295),(4296),(4297),(4298),(4299),(4300),(4301),(4302),(4303),(4304),(4305),(4306),(4307),(4308),(4309),(4310),(4311),(4312),(4313),(4314),(4315),(4316),(4317),(4318),(4319),(4320),(4321),(4322),(4323),(4324),(4325),(4326),(4327),(4328),(4329),(4330),(4331),(4332),(4333),(4334),(4335),(4336),(4337),(4338),(4339),(4340),(4341),(4342),(4343),(4344),(4345),(4346),(4347),(4348),(4349),(4350),(4351),(4352),(4353),(4354),(4355),(4356),(4357),(4358),(4359),(4360),(4361),(4362),(4363),(4364),(4365),(4366),(4367),(4368),(4369),(4370),(4371),(4372),(4373),(4374),(4375),(4376),(4377),(4378),(4379),(4380),(4381),(4382),(4383),(4384),(4385),(4386),(4387),(4388),(4389),(4390),(4391),(4392),(4393),(4394),(4395),(4396),(4397),(4398),(4399),(4400),(4401),(4402),(4403),(4404),(4405),(4406),(4407),(4408),(4409),(4410),(4411),(4412),(4413),(4414),(4415),(4416),(4417),(4418),(4419),(4420),(4421),(4422),(4423),(4424),(4425),(4426),(4427),(4428),(4429),(4430),(4431),(4432),(4433),(4434),(4435),(4436),(4437),(4438),(4439),(4440),(4441),(4442),(4443),(4444),(4445),(4446),(4447),(4448),(4449),(4450),(4451),(4452),(4453),(4454),(4455),(4456),(4457),(4458),(4459),(4460),(4461),(4462),(4463),(4464),(4465),(4466),(4467),(4468),(4469),(4470),(4471),(4472),(4473),(4474),(4475),(4476),(4477),(4478),(4479),(4480),(4481),(4482),(4483),(4484),(4485),(4486),(4487),(4488),(4489),(4490),(4491),(4492),(4493),(4494),(4495),(4496),(4497),(4498),(4499),(4500),(4501),(4502),(4503),(4504),(4505),(4506),(4507),(4508),(4509),(4510),(4511),(4512),(4513),(4514),(4515),(4516),(4517),(4518),(4519),(4520),(4521),(4522),(4523),(4524),(4525),(4526),(4527),(4528),(4529),(4530),(4531),(4532),(4533),(4534),(4535),(4536),(4537),(4538),(4539),(4540),(4541),(4542),(4543),(4544),(4545),(4546),(4547),(4548),(4549),(4550),(4551),(4552),(4553),(4554),(4555),(4556),(4557),(4558),(4559),(4560),(4561),(4562),(4563),(4564),(4565),(4566),(4567),(4568),(4569),(4570),(4571),(4572),(4573),(4574),(4575),(4576),(4577),(4578),(4579),(4580),(4581),(4582),(4583),(4584),(4585),(4586),(4587),(4588),(4589),(4590),(4591),(4592),(4593),(4594),(4595),(4596),(4597),(4598),(4599),(4600),(4601),(4602),(4603),(4604),(4605),(4606),(4607),(4608),(4609),(4610),(4611),(4612),(4613),(4614),(4615),(4616),(4617),(4618),(4619),(4620),(4621),(4622),(4623),(4624),(4625),(4626),(4627),(4628),(4629),(4630),(4631),(4632),(4633),(4634),(4635),(4636),(4637),(4638),(4639),(4640),(4641),(4642),(4643),(4644),(4645),(4646),(4647),(4648),(4649),(4650),(4651),(4652),(4653),(4654),(4655),(4656),(4657),(4658),(4659),(4660),(4661),(4662),(4663),(4664),(4665),(4666),(4667),(4668),(4669),(4670),(4671),(4672),(4673),(4674),(4675),(4676),(4677),(4678),(4679),(4680),(4681),(4682),(4683),(4684),(4685),(4686),(4687),(4688),(4689),(4690),(4691),(4692),(4693),(4694),(4695),(4696),(4697),(4698),(4699),(4700),(4701),(4702),(4703),(4704),(4705),(4706),(4707),(4708),(4709),(4710),(4711),(4712),(4713),(4714),(4715),(4716),(4717),(4718),(4719),(4720),(4721),(4722),(4723),(4724),(4725),(4726),(4727),(4728),(4729),(4730),(4731),(4732),(4733),(4734),(4735),(4736),(4737),(4738),(4739),(4740),(4741),(4742),(4743),(4744),(4745),(4746),(4747),(4748),(4749),(4750),(4751),(4752),(4753),(4754),(4755),(4756),(4757),(4758),(4759),(4760),(4761),(4762),(4763),(4764),(4765),(4766),(4767),(4768),(4769),(4770),(4771),(4772),(4773),(4774),(4775),(4776),(4777),(4778),(4779),(4780),(4781),(4782),(4783),(4784),(4785),(4786),(4787),(4788),(4789),(4790),(4791),(4792),(4793),(4794),(4795),(4796),(4797),(4798),(4799),(4800),(4801),(4802),(4803),(4804),(4805),(4806),(4807),(4808),(4809),(4810),(4811),(4812),(4813),(4814),(4815),(4816),(4817),(4818),(4819),(4820),(4821),(4822),(4823),(4824),(4825),(4826),(4827),(4828),(4829),(4830),(4831),(4832),(4833),(4834),(4835),(4836),(4837),(4838),(4839),(4840),(4841),(4842),(4843),(4844),(4845),(4846),(4847),(4848),(4849),(4850),(4851),(4852),(4853),(4854),(4855),(4856),(4857),(4858),(4859),(4860),(4861),(4862),(4863),(4864),(4865),(4866),(4867),(4868),(4869),(4870),(4871),(4872),(4873),(4874),(4875),(4876),(4877),(4878),(4879),(4880),(4881),(4882),(4883),(4884),(4885),(4886),(4887),(4888),(4889),(4890),(4891),(4892),(4893),(4894),(4895),(4896),(4897),(4898),(4899),(4900),(4901),(4902),(4903),(4904),(4905),(4906),(4907),(4908),(4909),(4910),(4911),(4912),(4913),(4914),(4915),(4916),(4917),(4918),(4919),(4920),(4921),(4922),(4923),(4924),(4925),(4926),(4927),(4928),(4929),(4930),(4931),(4932),(4933),(4934),(4935),(4936),(4937),(4938),(4939),(4940),(4941),(4942),(4943),(4944),(4945),(4946),(4947),(4948),(4949),(4950),(4951),(4952),(4953),(4954),(4955),(4956),(4957),(4958),(4959),(4960),(4961),(4962),(4963),(4964),(4965),(4966),(4967),(4968),(4969),(4970),(4971),(4972),(4973),(4974),(4975),(4976),(4977),(4978),(4979),(4980),(4981),(4982),(4983),(4984),(4985),(4986),(4987),(4988),(4989),(4990),(4991),(4992),(4993),(4994),(4995),(4996),(4997),(4998),(4999) +,(5000),(5001),(5002),(5003),(5004),(5005),(5006),(5007),(5008),(5009),(5010),(5011),(5012),(5013),(5014),(5015),(5016),(5017),(5018),(5019),(5020),(5021),(5022),(5023),(5024),(5025),(5026),(5027),(5028),(5029),(5030),(5031),(5032),(5033),(5034),(5035),(5036),(5037),(5038),(5039),(5040),(5041),(5042),(5043),(5044),(5045),(5046),(5047),(5048),(5049),(5050),(5051),(5052),(5053),(5054),(5055),(5056),(5057),(5058),(5059),(5060),(5061),(5062),(5063),(5064),(5065),(5066),(5067),(5068),(5069),(5070),(5071),(5072),(5073),(5074),(5075),(5076),(5077),(5078),(5079),(5080),(5081),(5082),(5083),(5084),(5085),(5086),(5087),(5088),(5089),(5090),(5091),(5092),(5093),(5094),(5095),(5096),(5097),(5098),(5099),(5100),(5101),(5102),(5103),(5104),(5105),(5106),(5107),(5108),(5109),(5110),(5111),(5112),(5113),(5114),(5115),(5116),(5117),(5118),(5119),(5120),(5121),(5122),(5123),(5124),(5125),(5126),(5127),(5128),(5129),(5130),(5131),(5132),(5133),(5134),(5135),(5136),(5137),(5138),(5139),(5140),(5141),(5142),(5143),(5144),(5145),(5146),(5147),(5148),(5149),(5150),(5151),(5152),(5153),(5154),(5155),(5156),(5157),(5158),(5159),(5160),(5161),(5162),(5163),(5164),(5165),(5166),(5167),(5168),(5169),(5170),(5171),(5172),(5173),(5174),(5175),(5176),(5177),(5178),(5179),(5180),(5181),(5182),(5183),(5184),(5185),(5186),(5187),(5188),(5189),(5190),(5191),(5192),(5193),(5194),(5195),(5196),(5197),(5198),(5199),(5200),(5201),(5202),(5203),(5204),(5205),(5206),(5207),(5208),(5209),(5210),(5211),(5212),(5213),(5214),(5215),(5216),(5217),(5218),(5219),(5220),(5221),(5222),(5223),(5224),(5225),(5226),(5227),(5228),(5229),(5230),(5231),(5232),(5233),(5234),(5235),(5236),(5237),(5238),(5239),(5240),(5241),(5242),(5243),(5244),(5245),(5246),(5247),(5248),(5249),(5250),(5251),(5252),(5253),(5254),(5255),(5256),(5257),(5258),(5259),(5260),(5261),(5262),(5263),(5264),(5265),(5266),(5267),(5268),(5269),(5270),(5271),(5272),(5273),(5274),(5275),(5276),(5277),(5278),(5279),(5280),(5281),(5282),(5283),(5284),(5285),(5286),(5287),(5288),(5289),(5290),(5291),(5292),(5293),(5294),(5295),(5296),(5297),(5298),(5299),(5300),(5301),(5302),(5303),(5304),(5305),(5306),(5307),(5308),(5309),(5310),(5311),(5312),(5313),(5314),(5315),(5316),(5317),(5318),(5319),(5320),(5321),(5322),(5323),(5324),(5325),(5326),(5327),(5328),(5329),(5330),(5331),(5332),(5333),(5334),(5335),(5336),(5337),(5338),(5339),(5340),(5341),(5342),(5343),(5344),(5345),(5346),(5347),(5348),(5349),(5350),(5351),(5352),(5353),(5354),(5355),(5356),(5357),(5358),(5359),(5360),(5361),(5362),(5363),(5364),(5365),(5366),(5367),(5368),(5369),(5370),(5371),(5372),(5373),(5374),(5375),(5376),(5377),(5378),(5379),(5380),(5381),(5382),(5383),(5384),(5385),(5386),(5387),(5388),(5389),(5390),(5391),(5392),(5393),(5394),(5395),(5396),(5397),(5398),(5399),(5400),(5401),(5402),(5403),(5404),(5405),(5406),(5407),(5408),(5409),(5410),(5411),(5412),(5413),(5414),(5415),(5416),(5417),(5418),(5419),(5420),(5421),(5422),(5423),(5424),(5425),(5426),(5427),(5428),(5429),(5430),(5431),(5432),(5433),(5434),(5435),(5436),(5437),(5438),(5439),(5440),(5441),(5442),(5443),(5444),(5445),(5446),(5447),(5448),(5449),(5450),(5451),(5452),(5453),(5454),(5455),(5456),(5457),(5458),(5459),(5460),(5461),(5462),(5463),(5464),(5465),(5466),(5467),(5468),(5469),(5470),(5471),(5472),(5473),(5474),(5475),(5476),(5477),(5478),(5479),(5480),(5481),(5482),(5483),(5484),(5485),(5486),(5487),(5488),(5489),(5490),(5491),(5492),(5493),(5494),(5495),(5496),(5497),(5498),(5499),(5500),(5501),(5502),(5503),(5504),(5505),(5506),(5507),(5508),(5509),(5510),(5511),(5512),(5513),(5514),(5515),(5516),(5517),(5518),(5519),(5520),(5521),(5522),(5523),(5524),(5525),(5526),(5527),(5528),(5529),(5530),(5531),(5532),(5533),(5534),(5535),(5536),(5537),(5538),(5539),(5540),(5541),(5542),(5543),(5544),(5545),(5546),(5547),(5548),(5549),(5550),(5551),(5552),(5553),(5554),(5555),(5556),(5557),(5558),(5559),(5560),(5561),(5562),(5563),(5564),(5565),(5566),(5567),(5568),(5569),(5570),(5571),(5572),(5573),(5574),(5575),(5576),(5577),(5578),(5579),(5580),(5581),(5582),(5583),(5584),(5585),(5586),(5587),(5588),(5589),(5590),(5591),(5592),(5593),(5594),(5595),(5596),(5597),(5598),(5599),(5600),(5601),(5602),(5603),(5604),(5605),(5606),(5607),(5608),(5609),(5610),(5611),(5612),(5613),(5614),(5615),(5616),(5617),(5618),(5619),(5620),(5621),(5622),(5623),(5624),(5625),(5626),(5627),(5628),(5629),(5630),(5631),(5632),(5633),(5634),(5635),(5636),(5637),(5638),(5639),(5640),(5641),(5642),(5643),(5644),(5645),(5646),(5647),(5648),(5649),(5650),(5651),(5652),(5653),(5654),(5655),(5656),(5657),(5658),(5659),(5660),(5661),(5662),(5663),(5664),(5665),(5666),(5667),(5668),(5669),(5670),(5671),(5672),(5673),(5674),(5675),(5676),(5677),(5678),(5679),(5680),(5681),(5682),(5683),(5684),(5685),(5686),(5687),(5688),(5689),(5690),(5691),(5692),(5693),(5694),(5695),(5696),(5697),(5698),(5699),(5700),(5701),(5702),(5703),(5704),(5705),(5706),(5707),(5708),(5709),(5710),(5711),(5712),(5713),(5714),(5715),(5716),(5717),(5718),(5719),(5720),(5721),(5722),(5723),(5724),(5725),(5726),(5727),(5728),(5729),(5730),(5731),(5732),(5733),(5734),(5735),(5736),(5737),(5738),(5739),(5740),(5741),(5742),(5743),(5744),(5745),(5746),(5747),(5748),(5749),(5750),(5751),(5752),(5753),(5754),(5755),(5756),(5757),(5758),(5759),(5760),(5761),(5762),(5763),(5764),(5765),(5766),(5767),(5768),(5769),(5770),(5771),(5772),(5773),(5774),(5775),(5776),(5777),(5778),(5779),(5780),(5781),(5782),(5783),(5784),(5785),(5786),(5787),(5788),(5789),(5790),(5791),(5792),(5793),(5794),(5795),(5796),(5797),(5798),(5799),(5800),(5801),(5802),(5803),(5804),(5805),(5806),(5807),(5808),(5809),(5810),(5811),(5812),(5813),(5814),(5815),(5816),(5817),(5818),(5819),(5820),(5821),(5822),(5823),(5824),(5825),(5826),(5827),(5828),(5829),(5830),(5831),(5832),(5833),(5834),(5835),(5836),(5837),(5838),(5839),(5840),(5841),(5842),(5843),(5844),(5845),(5846),(5847),(5848),(5849),(5850),(5851),(5852),(5853),(5854),(5855),(5856),(5857),(5858),(5859),(5860),(5861),(5862),(5863),(5864),(5865),(5866),(5867),(5868),(5869),(5870),(5871),(5872),(5873),(5874),(5875),(5876),(5877),(5878),(5879),(5880),(5881),(5882),(5883),(5884),(5885),(5886),(5887),(5888),(5889),(5890),(5891),(5892),(5893),(5894),(5895),(5896),(5897),(5898),(5899),(5900),(5901),(5902),(5903),(5904),(5905),(5906),(5907),(5908),(5909),(5910),(5911),(5912),(5913),(5914),(5915),(5916),(5917),(5918),(5919),(5920),(5921),(5922),(5923),(5924),(5925),(5926),(5927),(5928),(5929),(5930),(5931),(5932),(5933),(5934),(5935),(5936),(5937),(5938),(5939),(5940),(5941),(5942),(5943),(5944),(5945),(5946),(5947),(5948),(5949),(5950),(5951),(5952),(5953),(5954),(5955),(5956),(5957),(5958),(5959),(5960),(5961),(5962),(5963),(5964),(5965),(5966),(5967),(5968),(5969),(5970),(5971),(5972),(5973),(5974),(5975),(5976),(5977),(5978),(5979),(5980),(5981),(5982),(5983),(5984),(5985),(5986),(5987),(5988),(5989),(5990),(5991),(5992),(5993),(5994),(5995),(5996),(5997),(5998),(5999) +,(6000),(6001),(6002),(6003),(6004),(6005),(6006),(6007),(6008),(6009),(6010),(6011),(6012),(6013),(6014),(6015),(6016),(6017),(6018),(6019),(6020),(6021),(6022),(6023),(6024),(6025),(6026),(6027),(6028),(6029),(6030),(6031),(6032),(6033),(6034),(6035),(6036),(6037),(6038),(6039),(6040),(6041),(6042),(6043),(6044),(6045),(6046),(6047),(6048),(6049),(6050),(6051),(6052),(6053),(6054),(6055),(6056),(6057),(6058),(6059),(6060),(6061),(6062),(6063),(6064),(6065),(6066),(6067),(6068),(6069),(6070),(6071),(6072),(6073),(6074),(6075),(6076),(6077),(6078),(6079),(6080),(6081),(6082),(6083),(6084),(6085),(6086),(6087),(6088),(6089),(6090),(6091),(6092),(6093),(6094),(6095),(6096),(6097),(6098),(6099),(6100),(6101),(6102),(6103),(6104),(6105),(6106),(6107),(6108),(6109),(6110),(6111),(6112),(6113),(6114),(6115),(6116),(6117),(6118),(6119),(6120),(6121),(6122),(6123),(6124),(6125),(6126),(6127),(6128),(6129),(6130),(6131),(6132),(6133),(6134),(6135),(6136),(6137),(6138),(6139),(6140),(6141),(6142),(6143),(6144),(6145),(6146),(6147),(6148),(6149),(6150),(6151),(6152),(6153),(6154),(6155),(6156),(6157),(6158),(6159),(6160),(6161),(6162),(6163),(6164),(6165),(6166),(6167),(6168),(6169),(6170),(6171),(6172),(6173),(6174),(6175),(6176),(6177),(6178),(6179),(6180),(6181),(6182),(6183),(6184),(6185),(6186),(6187),(6188),(6189),(6190),(6191),(6192),(6193),(6194),(6195),(6196),(6197),(6198),(6199),(6200),(6201),(6202),(6203),(6204),(6205),(6206),(6207),(6208),(6209),(6210),(6211),(6212),(6213),(6214),(6215),(6216),(6217),(6218),(6219),(6220),(6221),(6222),(6223),(6224),(6225),(6226),(6227),(6228),(6229),(6230),(6231),(6232),(6233),(6234),(6235),(6236),(6237),(6238),(6239),(6240),(6241),(6242),(6243),(6244),(6245),(6246),(6247),(6248),(6249),(6250),(6251),(6252),(6253),(6254),(6255),(6256),(6257),(6258),(6259),(6260),(6261),(6262),(6263),(6264),(6265),(6266),(6267),(6268),(6269),(6270),(6271),(6272),(6273),(6274),(6275),(6276),(6277),(6278),(6279),(6280),(6281),(6282),(6283),(6284),(6285),(6286),(6287),(6288),(6289),(6290),(6291),(6292),(6293),(6294),(6295),(6296),(6297),(6298),(6299),(6300),(6301),(6302),(6303),(6304),(6305),(6306),(6307),(6308),(6309),(6310),(6311),(6312),(6313),(6314),(6315),(6316),(6317),(6318),(6319),(6320),(6321),(6322),(6323),(6324),(6325),(6326),(6327),(6328),(6329),(6330),(6331),(6332),(6333),(6334),(6335),(6336),(6337),(6338),(6339),(6340),(6341),(6342),(6343),(6344),(6345),(6346),(6347),(6348),(6349),(6350),(6351),(6352),(6353),(6354),(6355),(6356),(6357),(6358),(6359),(6360),(6361),(6362),(6363),(6364),(6365),(6366),(6367),(6368),(6369),(6370),(6371),(6372),(6373),(6374),(6375),(6376),(6377),(6378),(6379),(6380),(6381),(6382),(6383),(6384),(6385),(6386),(6387),(6388),(6389),(6390),(6391),(6392),(6393),(6394),(6395),(6396),(6397),(6398),(6399),(6400),(6401),(6402),(6403),(6404),(6405),(6406),(6407),(6408),(6409),(6410),(6411),(6412),(6413),(6414),(6415),(6416),(6417),(6418),(6419),(6420),(6421),(6422),(6423),(6424),(6425),(6426),(6427),(6428),(6429),(6430),(6431),(6432),(6433),(6434),(6435),(6436),(6437),(6438),(6439),(6440),(6441),(6442),(6443),(6444),(6445),(6446),(6447),(6448),(6449),(6450),(6451),(6452),(6453),(6454),(6455),(6456),(6457),(6458),(6459),(6460),(6461),(6462),(6463),(6464),(6465),(6466),(6467),(6468),(6469),(6470),(6471),(6472),(6473),(6474),(6475),(6476),(6477),(6478),(6479),(6480),(6481),(6482),(6483),(6484),(6485),(6486),(6487),(6488),(6489),(6490),(6491),(6492),(6493),(6494),(6495),(6496),(6497),(6498),(6499),(6500),(6501),(6502),(6503),(6504),(6505),(6506),(6507),(6508),(6509),(6510),(6511),(6512),(6513),(6514),(6515),(6516),(6517),(6518),(6519),(6520),(6521),(6522),(6523),(6524),(6525),(6526),(6527),(6528),(6529),(6530),(6531),(6532),(6533),(6534),(6535),(6536),(6537),(6538),(6539),(6540),(6541),(6542),(6543),(6544),(6545),(6546),(6547),(6548),(6549),(6550),(6551),(6552),(6553),(6554),(6555),(6556),(6557),(6558),(6559),(6560),(6561),(6562),(6563),(6564),(6565),(6566),(6567),(6568),(6569),(6570),(6571),(6572),(6573),(6574),(6575),(6576),(6577),(6578),(6579),(6580),(6581),(6582),(6583),(6584),(6585),(6586),(6587),(6588),(6589),(6590),(6591),(6592),(6593),(6594),(6595),(6596),(6597),(6598),(6599),(6600),(6601),(6602),(6603),(6604),(6605),(6606),(6607),(6608),(6609),(6610),(6611),(6612),(6613),(6614),(6615),(6616),(6617),(6618),(6619),(6620),(6621),(6622),(6623),(6624),(6625),(6626),(6627),(6628),(6629),(6630),(6631),(6632),(6633),(6634),(6635),(6636),(6637),(6638),(6639),(6640),(6641),(6642),(6643),(6644),(6645),(6646),(6647),(6648),(6649),(6650),(6651),(6652),(6653),(6654),(6655),(6656),(6657),(6658),(6659),(6660),(6661),(6662),(6663),(6664),(6665),(6666),(6667),(6668),(6669),(6670),(6671),(6672),(6673),(6674),(6675),(6676),(6677),(6678),(6679),(6680),(6681),(6682),(6683),(6684),(6685),(6686),(6687),(6688),(6689),(6690),(6691),(6692),(6693),(6694),(6695),(6696),(6697),(6698),(6699),(6700),(6701),(6702),(6703),(6704),(6705),(6706),(6707),(6708),(6709),(6710),(6711),(6712),(6713),(6714),(6715),(6716),(6717),(6718),(6719),(6720),(6721),(6722),(6723),(6724),(6725),(6726),(6727),(6728),(6729),(6730),(6731),(6732),(6733),(6734),(6735),(6736),(6737),(6738),(6739),(6740),(6741),(6742),(6743),(6744),(6745),(6746),(6747),(6748),(6749),(6750),(6751),(6752),(6753),(6754),(6755),(6756),(6757),(6758),(6759),(6760),(6761),(6762),(6763),(6764),(6765),(6766),(6767),(6768),(6769),(6770),(6771),(6772),(6773),(6774),(6775),(6776),(6777),(6778),(6779),(6780),(6781),(6782),(6783),(6784),(6785),(6786),(6787),(6788),(6789),(6790),(6791),(6792),(6793),(6794),(6795),(6796),(6797),(6798),(6799),(6800),(6801),(6802),(6803),(6804),(6805),(6806),(6807),(6808),(6809),(6810),(6811),(6812),(6813),(6814),(6815),(6816),(6817),(6818),(6819),(6820),(6821),(6822),(6823),(6824),(6825),(6826),(6827),(6828),(6829),(6830),(6831),(6832),(6833),(6834),(6835),(6836),(6837),(6838),(6839),(6840),(6841),(6842),(6843),(6844),(6845),(6846),(6847),(6848),(6849),(6850),(6851),(6852),(6853),(6854),(6855),(6856),(6857),(6858),(6859),(6860),(6861),(6862),(6863),(6864),(6865),(6866),(6867),(6868),(6869),(6870),(6871),(6872),(6873),(6874),(6875),(6876),(6877),(6878),(6879),(6880),(6881),(6882),(6883),(6884),(6885),(6886),(6887),(6888),(6889),(6890),(6891),(6892),(6893),(6894),(6895),(6896),(6897),(6898),(6899),(6900),(6901),(6902),(6903),(6904),(6905),(6906),(6907),(6908),(6909),(6910),(6911),(6912),(6913),(6914),(6915),(6916),(6917),(6918),(6919),(6920),(6921),(6922),(6923),(6924),(6925),(6926),(6927),(6928),(6929),(6930),(6931),(6932),(6933),(6934),(6935),(6936),(6937),(6938),(6939),(6940),(6941),(6942),(6943),(6944),(6945),(6946),(6947),(6948),(6949),(6950),(6951),(6952),(6953),(6954),(6955),(6956),(6957),(6958),(6959),(6960),(6961),(6962),(6963),(6964),(6965),(6966),(6967),(6968),(6969),(6970),(6971),(6972),(6973),(6974),(6975),(6976),(6977),(6978),(6979),(6980),(6981),(6982),(6983),(6984),(6985),(6986),(6987),(6988),(6989),(6990),(6991),(6992),(6993),(6994),(6995),(6996),(6997),(6998),(6999) +,(7000),(7001),(7002),(7003),(7004),(7005),(7006),(7007),(7008),(7009),(7010),(7011),(7012),(7013),(7014),(7015),(7016),(7017),(7018),(7019),(7020),(7021),(7022),(7023),(7024),(7025),(7026),(7027),(7028),(7029),(7030),(7031),(7032),(7033),(7034),(7035),(7036),(7037),(7038),(7039),(7040),(7041),(7042),(7043),(7044),(7045),(7046),(7047),(7048),(7049),(7050),(7051),(7052),(7053),(7054),(7055),(7056),(7057),(7058),(7059),(7060),(7061),(7062),(7063),(7064),(7065),(7066),(7067),(7068),(7069),(7070),(7071),(7072),(7073),(7074),(7075),(7076),(7077),(7078),(7079),(7080),(7081),(7082),(7083),(7084),(7085),(7086),(7087),(7088),(7089),(7090),(7091),(7092),(7093),(7094),(7095),(7096),(7097),(7098),(7099),(7100),(7101),(7102),(7103),(7104),(7105),(7106),(7107),(7108),(7109),(7110),(7111),(7112),(7113),(7114),(7115),(7116),(7117),(7118),(7119),(7120),(7121),(7122),(7123),(7124),(7125),(7126),(7127),(7128),(7129),(7130),(7131),(7132),(7133),(7134),(7135),(7136),(7137),(7138),(7139),(7140),(7141),(7142),(7143),(7144),(7145),(7146),(7147),(7148),(7149),(7150),(7151),(7152),(7153),(7154),(7155),(7156),(7157),(7158),(7159),(7160),(7161),(7162),(7163),(7164),(7165),(7166),(7167),(7168),(7169),(7170),(7171),(7172),(7173),(7174),(7175),(7176),(7177),(7178),(7179),(7180),(7181),(7182),(7183),(7184),(7185),(7186),(7187),(7188),(7189),(7190),(7191),(7192),(7193),(7194),(7195),(7196),(7197),(7198),(7199),(7200),(7201),(7202),(7203),(7204),(7205),(7206),(7207),(7208),(7209),(7210),(7211),(7212),(7213),(7214),(7215),(7216),(7217),(7218),(7219),(7220),(7221),(7222),(7223),(7224),(7225),(7226),(7227),(7228),(7229),(7230),(7231),(7232),(7233),(7234),(7235),(7236),(7237),(7238),(7239),(7240),(7241),(7242),(7243),(7244),(7245),(7246),(7247),(7248),(7249),(7250),(7251),(7252),(7253),(7254),(7255),(7256),(7257),(7258),(7259),(7260),(7261),(7262),(7263),(7264),(7265),(7266),(7267),(7268),(7269),(7270),(7271),(7272),(7273),(7274),(7275),(7276),(7277),(7278),(7279),(7280),(7281),(7282),(7283),(7284),(7285),(7286),(7287),(7288),(7289),(7290),(7291),(7292),(7293),(7294),(7295),(7296),(7297),(7298),(7299),(7300),(7301),(7302),(7303),(7304),(7305),(7306),(7307),(7308),(7309),(7310),(7311),(7312),(7313),(7314),(7315),(7316),(7317),(7318),(7319),(7320),(7321),(7322),(7323),(7324),(7325),(7326),(7327),(7328),(7329),(7330),(7331),(7332),(7333),(7334),(7335),(7336),(7337),(7338),(7339),(7340),(7341),(7342),(7343),(7344),(7345),(7346),(7347),(7348),(7349),(7350),(7351),(7352),(7353),(7354),(7355),(7356),(7357),(7358),(7359),(7360),(7361),(7362),(7363),(7364),(7365),(7366),(7367),(7368),(7369),(7370),(7371),(7372),(7373),(7374),(7375),(7376),(7377),(7378),(7379),(7380),(7381),(7382),(7383),(7384),(7385),(7386),(7387),(7388),(7389),(7390),(7391),(7392),(7393),(7394),(7395),(7396),(7397),(7398),(7399),(7400),(7401),(7402),(7403),(7404),(7405),(7406),(7407),(7408),(7409),(7410),(7411),(7412),(7413),(7414),(7415),(7416),(7417),(7418),(7419),(7420),(7421),(7422),(7423),(7424),(7425),(7426),(7427),(7428),(7429),(7430),(7431),(7432),(7433),(7434),(7435),(7436),(7437),(7438),(7439),(7440),(7441),(7442),(7443),(7444),(7445),(7446),(7447),(7448),(7449),(7450),(7451),(7452),(7453),(7454),(7455),(7456),(7457),(7458),(7459),(7460),(7461),(7462),(7463),(7464),(7465),(7466),(7467),(7468),(7469),(7470),(7471),(7472),(7473),(7474),(7475),(7476),(7477),(7478),(7479),(7480),(7481),(7482),(7483),(7484),(7485),(7486),(7487),(7488),(7489),(7490),(7491),(7492),(7493),(7494),(7495),(7496),(7497),(7498),(7499),(7500),(7501),(7502),(7503),(7504),(7505),(7506),(7507),(7508),(7509),(7510),(7511),(7512),(7513),(7514),(7515),(7516),(7517),(7518),(7519),(7520),(7521),(7522),(7523),(7524),(7525),(7526),(7527),(7528),(7529),(7530),(7531),(7532),(7533),(7534),(7535),(7536),(7537),(7538),(7539),(7540),(7541),(7542),(7543),(7544),(7545),(7546),(7547),(7548),(7549),(7550),(7551),(7552),(7553),(7554),(7555),(7556),(7557),(7558),(7559),(7560),(7561),(7562),(7563),(7564),(7565),(7566),(7567),(7568),(7569),(7570),(7571),(7572),(7573),(7574),(7575),(7576),(7577),(7578),(7579),(7580),(7581),(7582),(7583),(7584),(7585),(7586),(7587),(7588),(7589),(7590),(7591),(7592),(7593),(7594),(7595),(7596),(7597),(7598),(7599),(7600),(7601),(7602),(7603),(7604),(7605),(7606),(7607),(7608),(7609),(7610),(7611),(7612),(7613),(7614),(7615),(7616),(7617),(7618),(7619),(7620),(7621),(7622),(7623),(7624),(7625),(7626),(7627),(7628),(7629),(7630),(7631),(7632),(7633),(7634),(7635),(7636),(7637),(7638),(7639),(7640),(7641),(7642),(7643),(7644),(7645),(7646),(7647),(7648),(7649),(7650),(7651),(7652),(7653),(7654),(7655),(7656),(7657),(7658),(7659),(7660),(7661),(7662),(7663),(7664),(7665),(7666),(7667),(7668),(7669),(7670),(7671),(7672),(7673),(7674),(7675),(7676),(7677),(7678),(7679),(7680),(7681),(7682),(7683),(7684),(7685),(7686),(7687),(7688),(7689),(7690),(7691),(7692),(7693),(7694),(7695),(7696),(7697),(7698),(7699),(7700),(7701),(7702),(7703),(7704),(7705),(7706),(7707),(7708),(7709),(7710),(7711),(7712),(7713),(7714),(7715),(7716),(7717),(7718),(7719),(7720),(7721),(7722),(7723),(7724),(7725),(7726),(7727),(7728),(7729),(7730),(7731),(7732),(7733),(7734),(7735),(7736),(7737),(7738),(7739),(7740),(7741),(7742),(7743),(7744),(7745),(7746),(7747),(7748),(7749),(7750),(7751),(7752),(7753),(7754),(7755),(7756),(7757),(7758),(7759),(7760),(7761),(7762),(7763),(7764),(7765),(7766),(7767),(7768),(7769),(7770),(7771),(7772),(7773),(7774),(7775),(7776),(7777),(7778),(7779),(7780),(7781),(7782),(7783),(7784),(7785),(7786),(7787),(7788),(7789),(7790),(7791),(7792),(7793),(7794),(7795),(7796),(7797),(7798),(7799),(7800),(7801),(7802),(7803),(7804),(7805),(7806),(7807),(7808),(7809),(7810),(7811),(7812),(7813),(7814),(7815),(7816),(7817),(7818),(7819),(7820),(7821),(7822),(7823),(7824),(7825),(7826),(7827),(7828),(7829),(7830),(7831),(7832),(7833),(7834),(7835),(7836),(7837),(7838),(7839),(7840),(7841),(7842),(7843),(7844),(7845),(7846),(7847),(7848),(7849),(7850),(7851),(7852),(7853),(7854),(7855),(7856),(7857),(7858),(7859),(7860),(7861),(7862),(7863),(7864),(7865),(7866),(7867),(7868),(7869),(7870),(7871),(7872),(7873),(7874),(7875),(7876),(7877),(7878),(7879),(7880),(7881),(7882),(7883),(7884),(7885),(7886),(7887),(7888),(7889),(7890),(7891),(7892),(7893),(7894),(7895),(7896),(7897),(7898),(7899),(7900),(7901),(7902),(7903),(7904),(7905),(7906),(7907),(7908),(7909),(7910),(7911),(7912),(7913),(7914),(7915),(7916),(7917),(7918),(7919),(7920),(7921),(7922),(7923),(7924),(7925),(7926),(7927),(7928),(7929),(7930),(7931),(7932),(7933),(7934),(7935),(7936),(7937),(7938),(7939),(7940),(7941),(7942),(7943),(7944),(7945),(7946),(7947),(7948),(7949),(7950),(7951),(7952),(7953),(7954),(7955),(7956),(7957),(7958),(7959),(7960),(7961),(7962),(7963),(7964),(7965),(7966),(7967),(7968),(7969),(7970),(7971),(7972),(7973),(7974),(7975),(7976),(7977),(7978),(7979),(7980),(7981),(7982),(7983),(7984),(7985),(7986),(7987),(7988),(7989),(7990),(7991),(7992),(7993),(7994),(7995),(7996),(7997),(7998),(7999) +,(8000),(8001),(8002),(8003),(8004),(8005),(8006),(8007),(8008),(8009),(8010),(8011),(8012),(8013),(8014),(8015),(8016),(8017),(8018),(8019),(8020),(8021),(8022),(8023),(8024),(8025),(8026),(8027),(8028),(8029),(8030),(8031),(8032),(8033),(8034),(8035),(8036),(8037),(8038),(8039),(8040),(8041),(8042),(8043),(8044),(8045),(8046),(8047),(8048),(8049),(8050),(8051),(8052),(8053),(8054),(8055),(8056),(8057),(8058),(8059),(8060),(8061),(8062),(8063),(8064),(8065),(8066),(8067),(8068),(8069),(8070),(8071),(8072),(8073),(8074),(8075),(8076),(8077),(8078),(8079),(8080),(8081),(8082),(8083),(8084),(8085),(8086),(8087),(8088),(8089),(8090),(8091),(8092),(8093),(8094),(8095),(8096),(8097),(8098),(8099),(8100),(8101),(8102),(8103),(8104),(8105),(8106),(8107),(8108),(8109),(8110),(8111),(8112),(8113),(8114),(8115),(8116),(8117),(8118),(8119),(8120),(8121),(8122),(8123),(8124),(8125),(8126),(8127),(8128),(8129),(8130),(8131),(8132),(8133),(8134),(8135),(8136),(8137),(8138),(8139),(8140),(8141),(8142),(8143),(8144),(8145),(8146),(8147),(8148),(8149),(8150),(8151),(8152),(8153),(8154),(8155),(8156),(8157),(8158),(8159),(8160),(8161),(8162),(8163),(8164),(8165),(8166),(8167),(8168),(8169),(8170),(8171),(8172),(8173),(8174),(8175),(8176),(8177),(8178),(8179),(8180),(8181),(8182),(8183),(8184),(8185),(8186),(8187),(8188),(8189),(8190),(8191),(8192),(8193),(8194),(8195),(8196),(8197),(8198),(8199),(8200),(8201),(8202),(8203),(8204),(8205),(8206),(8207),(8208),(8209),(8210),(8211),(8212),(8213),(8214),(8215),(8216),(8217),(8218),(8219),(8220),(8221),(8222),(8223),(8224),(8225),(8226),(8227),(8228),(8229),(8230),(8231),(8232),(8233),(8234),(8235),(8236),(8237),(8238),(8239),(8240),(8241),(8242),(8243),(8244),(8245),(8246),(8247),(8248),(8249),(8250),(8251),(8252),(8253),(8254),(8255),(8256),(8257),(8258),(8259),(8260),(8261),(8262),(8263),(8264),(8265),(8266),(8267),(8268),(8269),(8270),(8271),(8272),(8273),(8274),(8275),(8276),(8277),(8278),(8279),(8280),(8281),(8282),(8283),(8284),(8285),(8286),(8287),(8288),(8289),(8290),(8291),(8292),(8293),(8294),(8295),(8296),(8297),(8298),(8299),(8300),(8301),(8302),(8303),(8304),(8305),(8306),(8307),(8308),(8309),(8310),(8311),(8312),(8313),(8314),(8315),(8316),(8317),(8318),(8319),(8320),(8321),(8322),(8323),(8324),(8325),(8326),(8327),(8328),(8329),(8330),(8331),(8332),(8333),(8334),(8335),(8336),(8337),(8338),(8339),(8340),(8341),(8342),(8343),(8344),(8345),(8346),(8347),(8348),(8349),(8350),(8351),(8352),(8353),(8354),(8355),(8356),(8357),(8358),(8359),(8360),(8361),(8362),(8363),(8364),(8365),(8366),(8367),(8368),(8369),(8370),(8371),(8372),(8373),(8374),(8375),(8376),(8377),(8378),(8379),(8380),(8381),(8382),(8383),(8384),(8385),(8386),(8387),(8388),(8389),(8390),(8391),(8392),(8393),(8394),(8395),(8396),(8397),(8398),(8399),(8400),(8401),(8402),(8403),(8404),(8405),(8406),(8407),(8408),(8409),(8410),(8411),(8412),(8413),(8414),(8415),(8416),(8417),(8418),(8419),(8420),(8421),(8422),(8423),(8424),(8425),(8426),(8427),(8428),(8429),(8430),(8431),(8432),(8433),(8434),(8435),(8436),(8437),(8438),(8439),(8440),(8441),(8442),(8443),(8444),(8445),(8446),(8447),(8448),(8449),(8450),(8451),(8452),(8453),(8454),(8455),(8456),(8457),(8458),(8459),(8460),(8461),(8462),(8463),(8464),(8465),(8466),(8467),(8468),(8469),(8470),(8471),(8472),(8473),(8474),(8475),(8476),(8477),(8478),(8479),(8480),(8481),(8482),(8483),(8484),(8485),(8486),(8487),(8488),(8489),(8490),(8491),(8492),(8493),(8494),(8495),(8496),(8497),(8498),(8499),(8500),(8501),(8502),(8503),(8504),(8505),(8506),(8507),(8508),(8509),(8510),(8511),(8512),(8513),(8514),(8515),(8516),(8517),(8518),(8519),(8520),(8521),(8522),(8523),(8524),(8525),(8526),(8527),(8528),(8529),(8530),(8531),(8532),(8533),(8534),(8535),(8536),(8537),(8538),(8539),(8540),(8541),(8542),(8543),(8544),(8545),(8546),(8547),(8548),(8549),(8550),(8551),(8552),(8553),(8554),(8555),(8556),(8557),(8558),(8559),(8560),(8561),(8562),(8563),(8564),(8565),(8566),(8567),(8568),(8569),(8570),(8571),(8572),(8573),(8574),(8575),(8576),(8577),(8578),(8579),(8580),(8581),(8582),(8583),(8584),(8585),(8586),(8587),(8588),(8589),(8590),(8591),(8592),(8593),(8594),(8595),(8596),(8597),(8598),(8599),(8600),(8601),(8602),(8603),(8604),(8605),(8606),(8607),(8608),(8609),(8610),(8611),(8612),(8613),(8614),(8615),(8616),(8617),(8618),(8619),(8620),(8621),(8622),(8623),(8624),(8625),(8626),(8627),(8628),(8629),(8630),(8631),(8632),(8633),(8634),(8635),(8636),(8637),(8638),(8639),(8640),(8641),(8642),(8643),(8644),(8645),(8646),(8647),(8648),(8649),(8650),(8651),(8652),(8653),(8654),(8655),(8656),(8657),(8658),(8659),(8660),(8661),(8662),(8663),(8664),(8665),(8666),(8667),(8668),(8669),(8670),(8671),(8672),(8673),(8674),(8675),(8676),(8677),(8678),(8679),(8680),(8681),(8682),(8683),(8684),(8685),(8686),(8687),(8688),(8689),(8690),(8691),(8692),(8693),(8694),(8695),(8696),(8697),(8698),(8699),(8700),(8701),(8702),(8703),(8704),(8705),(8706),(8707),(8708),(8709),(8710),(8711),(8712),(8713),(8714),(8715),(8716),(8717),(8718),(8719),(8720),(8721),(8722),(8723),(8724),(8725),(8726),(8727),(8728),(8729),(8730),(8731),(8732),(8733),(8734),(8735),(8736),(8737),(8738),(8739),(8740),(8741),(8742),(8743),(8744),(8745),(8746),(8747),(8748),(8749),(8750),(8751),(8752),(8753),(8754),(8755),(8756),(8757),(8758),(8759),(8760),(8761),(8762),(8763),(8764),(8765),(8766),(8767),(8768),(8769),(8770),(8771),(8772),(8773),(8774),(8775),(8776),(8777),(8778),(8779),(8780),(8781),(8782),(8783),(8784),(8785),(8786),(8787),(8788),(8789),(8790),(8791),(8792),(8793),(8794),(8795),(8796),(8797),(8798),(8799),(8800),(8801),(8802),(8803),(8804),(8805),(8806),(8807),(8808),(8809),(8810),(8811),(8812),(8813),(8814),(8815),(8816),(8817),(8818),(8819),(8820),(8821),(8822),(8823),(8824),(8825),(8826),(8827),(8828),(8829),(8830),(8831),(8832),(8833),(8834),(8835),(8836),(8837),(8838),(8839),(8840),(8841),(8842),(8843),(8844),(8845),(8846),(8847),(8848),(8849),(8850),(8851),(8852),(8853),(8854),(8855),(8856),(8857),(8858),(8859),(8860),(8861),(8862),(8863),(8864),(8865),(8866),(8867),(8868),(8869),(8870),(8871),(8872),(8873),(8874),(8875),(8876),(8877),(8878),(8879),(8880),(8881),(8882),(8883),(8884),(8885),(8886),(8887),(8888),(8889),(8890),(8891),(8892),(8893),(8894),(8895),(8896),(8897),(8898),(8899),(8900),(8901),(8902),(8903),(8904),(8905),(8906),(8907),(8908),(8909),(8910),(8911),(8912),(8913),(8914),(8915),(8916),(8917),(8918),(8919),(8920),(8921),(8922),(8923),(8924),(8925),(8926),(8927),(8928),(8929),(8930),(8931),(8932),(8933),(8934),(8935),(8936),(8937),(8938),(8939),(8940),(8941),(8942),(8943),(8944),(8945),(8946),(8947),(8948),(8949),(8950),(8951),(8952),(8953),(8954),(8955),(8956),(8957),(8958),(8959),(8960),(8961),(8962),(8963),(8964),(8965),(8966),(8967),(8968),(8969),(8970),(8971),(8972),(8973),(8974),(8975),(8976),(8977),(8978),(8979),(8980),(8981),(8982),(8983),(8984),(8985),(8986),(8987),(8988),(8989),(8990),(8991),(8992),(8993),(8994),(8995),(8996),(8997),(8998),(8999) +,(9000),(9001),(9002),(9003),(9004),(9005),(9006),(9007),(9008),(9009),(9010),(9011),(9012),(9013),(9014),(9015),(9016),(9017),(9018),(9019),(9020),(9021),(9022),(9023),(9024),(9025),(9026),(9027),(9028),(9029),(9030),(9031),(9032),(9033),(9034),(9035),(9036),(9037),(9038),(9039),(9040),(9041),(9042),(9043),(9044),(9045),(9046),(9047),(9048),(9049),(9050),(9051),(9052),(9053),(9054),(9055),(9056),(9057),(9058),(9059),(9060),(9061),(9062),(9063),(9064),(9065),(9066),(9067),(9068),(9069),(9070),(9071),(9072),(9073),(9074),(9075),(9076),(9077),(9078),(9079),(9080),(9081),(9082),(9083),(9084),(9085),(9086),(9087),(9088),(9089),(9090),(9091),(9092),(9093),(9094),(9095),(9096),(9097),(9098),(9099),(9100),(9101),(9102),(9103),(9104),(9105),(9106),(9107),(9108),(9109),(9110),(9111),(9112),(9113),(9114),(9115),(9116),(9117),(9118),(9119),(9120),(9121),(9122),(9123),(9124),(9125),(9126),(9127),(9128),(9129),(9130),(9131),(9132),(9133),(9134),(9135),(9136),(9137),(9138),(9139),(9140),(9141),(9142),(9143),(9144),(9145),(9146),(9147),(9148),(9149),(9150),(9151),(9152),(9153),(9154),(9155),(9156),(9157),(9158),(9159),(9160),(9161),(9162),(9163),(9164),(9165),(9166),(9167),(9168),(9169),(9170),(9171),(9172),(9173),(9174),(9175),(9176),(9177),(9178),(9179),(9180),(9181),(9182),(9183),(9184),(9185),(9186),(9187),(9188),(9189),(9190),(9191),(9192),(9193),(9194),(9195),(9196),(9197),(9198),(9199),(9200),(9201),(9202),(9203),(9204),(9205),(9206),(9207),(9208),(9209),(9210),(9211),(9212),(9213),(9214),(9215),(9216),(9217),(9218),(9219),(9220),(9221),(9222),(9223),(9224),(9225),(9226),(9227),(9228),(9229),(9230),(9231),(9232),(9233),(9234),(9235),(9236),(9237),(9238),(9239),(9240),(9241),(9242),(9243),(9244),(9245),(9246),(9247),(9248),(9249),(9250),(9251),(9252),(9253),(9254),(9255),(9256),(9257),(9258),(9259),(9260),(9261),(9262),(9263),(9264),(9265),(9266),(9267),(9268),(9269),(9270),(9271),(9272),(9273),(9274),(9275),(9276),(9277),(9278),(9279),(9280),(9281),(9282),(9283),(9284),(9285),(9286),(9287),(9288),(9289),(9290),(9291),(9292),(9293),(9294),(9295),(9296),(9297),(9298),(9299),(9300),(9301),(9302),(9303),(9304),(9305),(9306),(9307),(9308),(9309),(9310),(9311),(9312),(9313),(9314),(9315),(9316),(9317),(9318),(9319),(9320),(9321),(9322),(9323),(9324),(9325),(9326),(9327),(9328),(9329),(9330),(9331),(9332),(9333),(9334),(9335),(9336),(9337),(9338),(9339),(9340),(9341),(9342),(9343),(9344),(9345),(9346),(9347),(9348),(9349),(9350),(9351),(9352),(9353),(9354),(9355),(9356),(9357),(9358),(9359),(9360),(9361),(9362),(9363),(9364),(9365),(9366),(9367),(9368),(9369),(9370),(9371),(9372),(9373),(9374),(9375),(9376),(9377),(9378),(9379),(9380),(9381),(9382),(9383),(9384),(9385),(9386),(9387),(9388),(9389),(9390),(9391),(9392),(9393),(9394),(9395),(9396),(9397),(9398),(9399),(9400),(9401),(9402),(9403),(9404),(9405),(9406),(9407),(9408),(9409),(9410),(9411),(9412),(9413),(9414),(9415),(9416),(9417),(9418),(9419),(9420),(9421),(9422),(9423),(9424),(9425),(9426),(9427),(9428),(9429),(9430),(9431),(9432),(9433),(9434),(9435),(9436),(9437),(9438),(9439),(9440),(9441),(9442),(9443),(9444),(9445),(9446),(9447),(9448),(9449),(9450),(9451),(9452),(9453),(9454),(9455),(9456),(9457),(9458),(9459),(9460),(9461),(9462),(9463),(9464),(9465),(9466),(9467),(9468),(9469),(9470),(9471),(9472),(9473),(9474),(9475),(9476),(9477),(9478),(9479),(9480),(9481),(9482),(9483),(9484),(9485),(9486),(9487),(9488),(9489),(9490),(9491),(9492),(9493),(9494),(9495),(9496),(9497),(9498),(9499),(9500),(9501),(9502),(9503),(9504),(9505),(9506),(9507),(9508),(9509),(9510),(9511),(9512),(9513),(9514),(9515),(9516),(9517),(9518),(9519),(9520),(9521),(9522),(9523),(9524),(9525),(9526),(9527),(9528),(9529),(9530),(9531),(9532),(9533),(9534),(9535),(9536),(9537),(9538),(9539),(9540),(9541),(9542),(9543),(9544),(9545),(9546),(9547),(9548),(9549),(9550),(9551),(9552),(9553),(9554),(9555),(9556),(9557),(9558),(9559),(9560),(9561),(9562),(9563),(9564),(9565),(9566),(9567),(9568),(9569),(9570),(9571),(9572),(9573),(9574),(9575),(9576),(9577),(9578),(9579),(9580),(9581),(9582),(9583),(9584),(9585),(9586),(9587),(9588),(9589),(9590),(9591),(9592),(9593),(9594),(9595),(9596),(9597),(9598),(9599),(9600),(9601),(9602),(9603),(9604),(9605),(9606),(9607),(9608),(9609),(9610),(9611),(9612),(9613),(9614),(9615),(9616),(9617),(9618),(9619),(9620),(9621),(9622),(9623),(9624),(9625),(9626),(9627),(9628),(9629),(9630),(9631),(9632),(9633),(9634),(9635),(9636),(9637),(9638),(9639),(9640),(9641),(9642),(9643),(9644),(9645),(9646),(9647),(9648),(9649),(9650),(9651),(9652),(9653),(9654),(9655),(9656),(9657),(9658),(9659),(9660),(9661),(9662),(9663),(9664),(9665),(9666),(9667),(9668),(9669),(9670),(9671),(9672),(9673),(9674),(9675),(9676),(9677),(9678),(9679),(9680),(9681),(9682),(9683),(9684),(9685),(9686),(9687),(9688),(9689),(9690),(9691),(9692),(9693),(9694),(9695),(9696),(9697),(9698),(9699),(9700),(9701),(9702),(9703),(9704),(9705),(9706),(9707),(9708),(9709),(9710),(9711),(9712),(9713),(9714),(9715),(9716),(9717),(9718),(9719),(9720),(9721),(9722),(9723),(9724),(9725),(9726),(9727),(9728),(9729),(9730),(9731),(9732),(9733),(9734),(9735),(9736),(9737),(9738),(9739),(9740),(9741),(9742),(9743),(9744),(9745),(9746),(9747),(9748),(9749),(9750),(9751),(9752),(9753),(9754),(9755),(9756),(9757),(9758),(9759),(9760),(9761),(9762),(9763),(9764),(9765),(9766),(9767),(9768),(9769),(9770),(9771),(9772),(9773),(9774),(9775),(9776),(9777),(9778),(9779),(9780),(9781),(9782),(9783),(9784),(9785),(9786),(9787),(9788),(9789),(9790),(9791),(9792),(9793),(9794),(9795),(9796),(9797),(9798),(9799),(9800),(9801),(9802),(9803),(9804),(9805),(9806),(9807),(9808),(9809),(9810),(9811),(9812),(9813),(9814),(9815),(9816),(9817),(9818),(9819),(9820),(9821),(9822),(9823),(9824),(9825),(9826),(9827),(9828),(9829),(9830),(9831),(9832),(9833),(9834),(9835),(9836),(9837),(9838),(9839),(9840),(9841),(9842),(9843),(9844),(9845),(9846),(9847),(9848),(9849),(9850),(9851),(9852),(9853),(9854),(9855),(9856),(9857),(9858),(9859),(9860),(9861),(9862),(9863),(9864),(9865),(9866),(9867),(9868),(9869),(9870),(9871),(9872),(9873),(9874),(9875),(9876),(9877),(9878),(9879),(9880),(9881),(9882),(9883),(9884),(9885),(9886),(9887),(9888),(9889),(9890),(9891),(9892),(9893),(9894),(9895),(9896),(9897),(9898),(9899),(9900),(9901),(9902),(9903),(9904),(9905),(9906),(9907),(9908),(9909),(9910),(9911),(9912),(9913),(9914),(9915),(9916),(9917),(9918),(9919),(9920),(9921),(9922),(9923),(9924),(9925),(9926),(9927),(9928),(9929),(9930),(9931),(9932),(9933),(9934),(9935),(9936),(9937),(9938),(9939),(9940),(9941),(9942),(9943),(9944),(9945),(9946),(9947),(9948),(9949),(9950),(9951),(9952),(9953),(9954),(9955),(9956),(9957),(9958),(9959),(9960),(9961),(9962),(9963),(9964),(9965),(9966),(9967),(9968),(9969),(9970),(9971),(9972),(9973),(9974),(9975),(9976),(9977),(9978),(9979),(9980),(9981),(9982),(9983),(9984),(9985),(9986),(9987),(9988),(9989),(9990),(9991),(9992),(9993),(9994),(9995),(9996),(9997),(9998),(9999) +,(10000) +; +/*!40000 ALTER TABLE `pt178` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2017-07-24 12:50:13 diff --git a/t/pt-online-schema-change/samples/stats-execute-5.7.txt b/t/pt-online-schema-change/samples/stats-execute-5.7.txt index aeb31344..47e7cd67 100644 --- a/t/pt-online-schema-change/samples/stats-execute-5.7.txt +++ b/t/pt-online-schema-change/samples/stats-execute-5.7.txt @@ -10,9 +10,10 @@ Operation, tries, wait: Altering `bug_1045317`.`bits`... TS Dropping triggers... TS Dropped triggers OK. -# Event Count -# ====== ===== -# INSERT 1 +# Event Count +# ================== ===== +# INSERT 1 +# mysql_warning_1592 1 Successfully altered `bug_1045317`.`bits`. Creating new table... Created new table bug_1045317._bits_new OK. diff --git a/t/pt-online-schema-change/samples/triggers.sql b/t/pt-online-schema-change/samples/triggers.sql new file mode 100644 index 00000000..d9576a1c --- /dev/null +++ b/t/pt-online-schema-change/samples/triggers.sql @@ -0,0 +1,99 @@ +-- MySQL dump 10.13 Distrib 5.7.12, for Linux (x86_64) +-- +-- Host: 127.0.0.1 Database: pt_osc +-- ------------------------------------------------------ +-- Server version 5.6.31-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `account` +-- + +DROP DATABASE IF EXISTS pt_osc; +CREATE DATABASE pt_osc; +USE pt_osc; + +DROP TABLE IF EXISTS `account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `second_key` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=20000 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account` +-- + +LOCK TABLES `account` WRITE; +/*!40000 ALTER TABLE `account` DISABLE KEYS */; +INSERT INTO `account` VALUES (1,10000001),(2,10000002),(3,10000003),(4,10000004),(5,10000005), +(6,10000006),(7,10000007),(8,10000008),(9,10000009),(10,10000010),(11,10000011),(12,10000012), +(13,10000013),(14,10000014),(15,10000015),(16,10000016),(17,10000017),(18,10000018),(19,10000019), +(20,10000020),(21,10000021),(22,10000022),(23,10000023),(24,10000024),(25,10000025),(26,10000026), +(27,10000027),(28,10000028),(29,10000029),(30,10000030),(31,10000031),(32,10000032),(33,10000033), +(34,10000034),(35,10000035),(36,10000036),(37,10000037),(38,10000038),(39,10000039),(40,10000040), +(41,10000041),(42,10000042),(43,10000043),(44,10000044),(45,10000045),(46,10000046),(47,10000047), +(48,10000048),(49,10000049),(50,10000050),(51,10000051),(52,10000052),(53,10000053),(54,10000054), +(55,10000055),(56,10000056),(57,10000057),(58,10000058),(59,10000059),(60,10000060),(61,10000061), +(62,10000062),(63,10000063),(64,10000064),(65,10000065),(66,10000066),(67,10000067),(68,10000068), +(69,10000069),(70,10000070),(71,10000071),(72,10000072),(73,10000073),(74,10000074),(75,10000075), +(76,10000076),(77,10000077),(78,10000078),(79,10000079),(80,10000080),(81,10000081),(82,10000082), +(83,10000083),(84,10000084),(85,10000085),(86,10000086),(87,10000087),(88,10000088),(89,10000089), +(90,10000090),(91,10000091),(92,10000092),(93,10000093),(94,10000094),(95,10000095),(96,10000096), +(97,10000097),(98,10000098),(99,10000099),(100,10000100),(101,10000101),(102,10000102),(103,10000103), +(104,10000104),(105,10000105),(106,10000106),(107,10000107),(108,10000108),(109,10000109),(110,10000110), +(111,10000111),(112,10000112),(113,10000113),(114,10000114),(115,10000115),(116,10000116),(117,10000117), +(118,10000118),(119,10000119),(120,10000120),(121,10000121),(122,10000122),(123,10000123),(124,10000124), +(125,10000125),(126,10000126),(127,10000127),(128,10000128),(129,10000129),(130,10000130),(131,10000131), +(132,10000132),(133,10000133),(134,10000134),(135,10000135),(136,10000136),(137,10000137),(138,10000138), +(139,10000139),(140,10000140),(141,10000141),(142,10000142),(143,10000143),(144,10000144),(145,10000145), +(146,10000146),(147,10000147),(148,10000148),(149,10000149),(150,10000150),(151,10000151),(152,10000152), +(153,10000153),(154,10000154),(155,10000155),(156,10000156),(157,10000157),(158,10000158),(159,10000159), +(160,10000160),(161,10000161),(162,10000162),(163,10000163),(164,10000164),(165,10000165),(166,10000166), +(167,10000167),(168,10000168),(169,10000169),(170,10000170),(171,10000171),(172,10000172),(173,10000173), +(174,10000174),(175,10000175),(176,10000176),(177,10000177),(178,10000178),(179,10000179),(180,10000180), +(181,10000181),(182,10000182),(183,10000183),(184,10000184),(185,10000185),(186,10000186),(187,10000187), +(188,10000188),(189,10000189),(190,10000190),(191,10000191),(192,10000192),(193,10000193),(194,10000194); +/*!40000 ALTER TABLE `account` ENABLE KEYS */; +UNLOCK TABLES; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER ins_sum + before INSERT ON account +FOR EACH ROW SET NEW.second_key = NEW.id + 10000000 */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2016-07-01 17:04:54 diff --git a/t/pt-online-schema-change/slave_lag.t b/t/pt-online-schema-change/slave_lag.t new file mode 100644 index 00000000..2631e21d --- /dev/null +++ b/t/pt-online-schema-change/slave_lag.t @@ -0,0 +1,121 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use threads; + +use English qw(-no_match_vars); +use Test::More; + +use Data::Dumper; +use PerconaTest; +use Sandbox; +use SqlModes; +use File::Temp qw/ tempdir /; + +plan tests => 4; +our $delay = 30; + +require "$trunk/bin/pt-online-schema-change"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $master_dbh = $sb->get_dbh_for('master'); +my $slave_dbh = $sb->get_dbh_for('slave1'); +my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox'; + +if ( !$master_dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} + +# 1) Set the slave delay to 0 just in case we are re-running the tests without restarting the sandbox. +# 2) Load sample data +# 3) Set the slave delay to 30 seconds to be able to see the 'waiting' message. +diag("Setting slave delay to 0 seconds"); +$slave_dbh->do('STOP SLAVE'); +$slave_dbh->do('RESET SLAVE'); +$slave_dbh->do('START SLAVE'); + +diag("Setting slave delay to $delay seconds"); + +$slave_dbh->do('STOP SLAVE'); +$slave_dbh->do("CHANGE MASTER TO MASTER_DELAY=$delay"); +$slave_dbh->do('START SLAVE'); + +diag('Loading test data'); +$sb->load_file('master', "t/pt-online-schema-change/samples/slave_lag.sql"); + +# Run a full table scan query to ensure the slave is behind the master +$master_dbh->do('RESET QUERY CACHE'); +$slave_dbh->do('RESET QUERY CACHE'); +$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""'); + +# This is the base test, ust to ensure that without using --check-slave-lag nor --skip-check-slave-lag +# pt-online-schema-change will wait on the slave at port 12346 + +my $max_lag = $delay / 2; +my $args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' "; +diag("Starting base test. This is going to take some time due to the delay in the slave"); +my $output = `$trunk/bin/pt-online-schema-change $args 2>&1`; + +like( + $output, + qr/Replica lag is \d+ seconds on .* Waiting/s, + "Base test waits on the correct slave", +); + +# Repeat the test now using --check-slave-lag +$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' " + . "--check-slave-lag h=127.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest"; + +# Run a full table scan query to ensure the slave is behind the master +$master_dbh->do('RESET QUERY CACHE'); +$slave_dbh->do('RESET QUERY CACHE'); +$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""'); + +diag("Starting --check-slave-lag test. This is going to take some time due to the delay in the slave"); +$output = `$trunk/bin/pt-online-schema-change $args 2>&1`; + +like( + $output, + qr/Replica lag is \d+ seconds on .* Waiting/s, + "--check-slave-lag waits on the correct slave", +); + +# Repeat the test now using --skip-check-slave-lag +# Run a full table scan query to ensure the slave is behind the master +$master_dbh->do('RESET QUERY CACHE'); +$slave_dbh->do('RESET QUERY CACHE'); +$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""'); + +$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' " + . "--skip-check-slave-lag h=127.0.0.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest"; + +diag("Starting --skip-check-slave-lag test. This is going to take some time due to the delay in the slave"); +$output = `$trunk/bin/pt-online-schema-change $args 2>&1`; + +unlike( + $output, + qr/Replica lag is \d+ seconds on .* Waiting/s, + "--skip-check-slave-lag is really skipping the slave", +); + +diag("Setting slave delay to 0 seconds"); +$slave_dbh->do('STOP SLAVE'); +$slave_dbh->do('RESET SLAVE'); +$slave_dbh->do('START SLAVE'); + +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($master_dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +done_testing; diff --git a/t/pt-stalk/pt-stalk.t b/t/pt-stalk/pt-stalk.t index a78d24fe..4f451f40 100644 --- a/t/pt-stalk/pt-stalk.t +++ b/t/pt-stalk/pt-stalk.t @@ -528,9 +528,56 @@ SKIP: { ); } +# ########################################################################### +# Test report about performance schema prepared_statements_instances in MySQL 5.7+ +# ########################################################################### + +cleanup(); + +SKIP: { + + skip "Only test on mysql 5.7" if ( $sandbox_version lt '5.7' ); + + sub start_thread_1642750 { + # this must run in a thread because we need to have an active session + # with prepared statements + my ($dsn_opts) = @_; + my $dp = new DSNParser(opts=>$dsn_opts); + my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); + my $dbh = $sb->get_dbh_for('master'); + $sb->load_file('master', "t/pt-stalk/samples/issue-1642750.sql"); + } + my $thr = threads->create('start_thread_1642750', $dsn_opts); + $thr->detach(); + threads->yield(); + + my $cmd = "$trunk/bin/pt-stalk --no-stalk --iterations=1 --host=127.0.0.1 --port=12345 --user=msandbox " + . "--password=msandbox --sleep 0 --run-time=10 --dest $dest --log $log_file --pid $pid_file " + . "--defaults-file=$cnf >$log_file 2>&1"; + + system($cmd); + sleep 15; + PerconaTest::kill_program(pid_file => $pid_file); + + $output = `cat $dest/*-prepared-statements 2>/dev/null`; + like( + $output, + qr/ STATEMENT_NAME: rand_statement/, + "MySQL 5.7 prepared statement: rand_statement" + ); + + like( + $output, + qr/ STATEMENT_NAME: abs_statement/, + "MySQL 5.7 prepared statement: abs_statement" + ); +} + # ############################################################################# # Done. # ############################################################################# + + cleanup(); diag(`rm -rf $dest 2>/dev/null`); ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); diff --git a/t/pt-stalk/samples/issue-1642750.sql b/t/pt-stalk/samples/issue-1642750.sql new file mode 100644 index 00000000..2ea2c15e --- /dev/null +++ b/t/pt-stalk/samples/issue-1642750.sql @@ -0,0 +1,11 @@ +/* Prepare two statements*/ + +SET @random_statement_prepare = 'SELECT RAND() AS rand'; +PREPARE rand_statement FROM @random_statement_prepare; + +SET @absolute_value_statement_prepare = 'SELECT ABS(?) AS abs_A'; +PREPARE abs_statement FROM @absolute_value_statement_prepare; + +/* Wait to let pt-stalk to collect the data and find these prepare statements */ +SELECT SLEEP(11); + diff --git a/t/pt-table-checksum/basics.t b/t/pt-table-checksum/basics.t index a81881ca..9be83a7a 100644 --- a/t/pt-table-checksum/basics.t +++ b/t/pt-table-checksum/basics.t @@ -105,7 +105,7 @@ ok( $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums"); -my $max_rows = $sandbox_version < '5.7' ? 75 : 100; +my $max_rows = $sandbox_version < '5.7' ? 90 : 100; ok( $row->[0] >= 75 && $row->[0] <= $max_rows, 'Between 75 and 90 chunks on master' diff --git a/t/pt-table-checksum/pt-136.t b/t/pt-table-checksum/pt-136.t new file mode 100644 index 00000000..7124c9df --- /dev/null +++ b/t/pt-table-checksum/pt-136.t @@ -0,0 +1,55 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; + +use PerconaTest; +use Sandbox; +use SqlModes; +require "$trunk/bin/pt-table-checksum"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('master'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +else { + plan tests => 2; +} + +$sb->load_file('master', 't/pt-table-checksum/samples/pt-136.sql'); +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the tool will die. +# And --max-load "" prevents waiting for status variables. +my $master_dsn = $sb->dsn_for('master'); +my @args = ($master_dsn); +my $output; +my $exit_status; + +$output = output( + sub { $exit_status = pt_table_checksum::main(@args) }, + stderr => 1, +); + +is( + $exit_status, + 0, + "Checksum columns with mismatching collaitons", +); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +exit; diff --git a/t/pt-table-checksum/pt-173.t b/t/pt-table-checksum/pt-173.t new file mode 100644 index 00000000..37959604 --- /dev/null +++ b/t/pt-table-checksum/pt-173.t @@ -0,0 +1,87 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; + +use PerconaTest; +use Sandbox; +use SqlModes; +require "$trunk/bin/pt-table-checksum"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('master'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +else { + plan tests => 4; +} + +$sb->load_file('master', 't/pt-table-checksum/samples/PT-173.sql'); +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the tool will die. +# And --max-load "" prevents waiting for status variables. +my $master_dsn = $sb->dsn_for('master'); +my @args = ($master_dsn, "--resume", "--truncate-replicate-table"); +my $output; +my $exit_status; + +# Test #1 +$output = output( + sub { $exit_status = pt_table_checksum::main(@args) }, + stderr => 1, +); + +isnt( + $exit_status, + 0, + "Cannot use --resume with --truncate-replicate-table", +); + +# Test #2 +@args = ($master_dsn, "--truncate-replicate-table"); +$output = output( + sub { $exit_status = pt_table_checksum::main(@args) }, + stderr => 1, +); + +my $row = $dbh->selectrow_arrayref('select count(*) from percona.checksums where `db` = "fake_db"'); + +is( + $row->[0], + 0, + "--truncate-replicate-table replicate table has been truncated", +); + +# Test #3 +$sb->load_file('master', 't/pt-table-checksum/samples/PT-173.sql'); + +@args = ($master_dsn, "--truncate-replicate-table", "--empty-replicate-table"); +$output = output( + sub { $exit_status = pt_table_checksum::main(@args) }, + stderr => 1, +); + +$row = $dbh->selectrow_arrayref('select count(*) from percona.checksums where `db` = "fake_db"'); +is( + $row->[0], + 0, + "--truncate-replicate-table has precedence over --empty-replicate-table", +); + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +exit; diff --git a/t/pt-table-checksum/pt-193.t b/t/pt-table-checksum/pt-193.t new file mode 100644 index 00000000..7f3af8d6 --- /dev/null +++ b/t/pt-table-checksum/pt-193.t @@ -0,0 +1,66 @@ +#!/usr/bin/env perl + +BEGIN { + die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" + unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; + unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; +}; + +use strict; +use warnings FATAL => 'all'; +use English qw(-no_match_vars); +use Test::More; + +use PerconaTest; +use Sandbox; +use SqlModes; +require "$trunk/bin/pt-table-checksum"; + +my $dp = new DSNParser(opts=>$dsn_opts); +my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); +my $dbh = $sb->get_dbh_for('master'); + +if ( !$dbh ) { + plan skip_all => 'Cannot connect to sandbox master'; +} +else { + plan tests => 3; +} + +$sb->load_file('master', 't/lib/samples/issue_pt-193_backtick_in_col_comments.sql'); + +# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic +# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the tool will die. +# And --max-load "" prevents waiting for status variables. +my $master_dsn = $sb->dsn_for('master'); +my @args = ($master_dsn, "--set-vars", "innodb_lock_wait_timeout=50", + "--no-check-binlog-format", "--ignore-databases", "mysql", + "--nocheck-replication-filters"); +my $output; +my $exit_status; + +# Test #1 +$output = output( + sub { $exit_status = pt_table_checksum::main(@args) }, + stderr => 1, +); + +is( + $exit_status, + 0, + "PT-193 use single backtick in comments", +); + +like( + $output, + qr/test\.t3/, + "PT-193 table t3 was checksumed", +); + + +# ############################################################################# +# Done. +# ############################################################################# +$sb->wipe_clean($dbh); +ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); +exit; diff --git a/t/pt-table-checksum/samples/PT-173.sql b/t/pt-table-checksum/samples/PT-173.sql new file mode 100644 index 00000000..6884d6ed --- /dev/null +++ b/t/pt-table-checksum/samples/PT-173.sql @@ -0,0 +1,66 @@ +-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) +-- +-- Host: 127.1 Database: percona +-- ------------------------------------------------------ +-- Server version 5.7.18-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `checksums` +-- +DROP DATABASE IF EXISTS percona; +CREATE DATABASE IF NOT EXISTS percona; + +USE percona; + +DROP TABLE IF EXISTS `checksums`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `checksums` ( + `db` char(64) NOT NULL, + `tbl` char(64) NOT NULL, + `chunk` int(11) NOT NULL, + `chunk_time` float DEFAULT NULL, + `chunk_index` varchar(200) DEFAULT NULL, + `lower_boundary` text, + `upper_boundary` text, + `this_crc` char(40) NOT NULL, + `this_cnt` int(11) NOT NULL, + `master_crc` char(40) DEFAULT NULL, + `master_cnt` int(11) DEFAULT NULL, + `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`db`,`tbl`,`chunk`), + KEY `ts_db_tbl` (`ts`,`db`,`tbl`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `checksums` +-- + +LOCK TABLES `checksums` WRITE; +/*!40000 ALTER TABLE `checksums` DISABLE KEYS */; +INSERT INTO `checksums` VALUES ('fake_db','checksums',1,0.000297,NULL,NULL,NULL,'d8b8e420',23,'d8b8e420',23,'2017-07-18 08:25:33'),('fake_db','load_data',1,0.000285,NULL,NULL,NULL,'42981178',1,'42981178',1,'2017-07-18 08:25:33'),('fake_db','sentinel',1,0.000294,NULL,NULL,NULL,'8bbdd2c',1,'8bbdd2c',1,'2017-07-18 08:25:33'),('mysql','columns_priv',1,0.000245,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:32'),('mysql','db',1,0.000238,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:32'),('mysql','engine_cost',1,0.000302,NULL,NULL,NULL,'343e658a',2,'343e658a',2,'2017-07-18 08:25:32'),('mysql','event',1,0.000249,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:32'),('mysql','func',1,0.000251,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:32'),('mysql','help_category',1,0.000289,NULL,NULL,NULL,'55da20fe',40,'55da20fe',40,'2017-07-18 08:25:32'),('mysql','help_keyword',1,0.000625,NULL,NULL,NULL,'7d8bbf2c',682,'7d8bbf2c',682,'2017-07-18 08:25:32'),('mysql','help_relation',1,0.000924,NULL,NULL,NULL,'a656850f',1340,'a656850f',1340,'2017-07-18 08:25:32'),('mysql','help_topic',1,0.008071,NULL,NULL,NULL,'6a9bafa9',637,'6a9bafa9',637,'2017-07-18 08:25:33'),('mysql','ndb_binlog_index',1,0.000896,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','plugin',1,0.001212,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','proc',1,0.000408,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','procs_priv',1,0.000271,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','proxies_priv',1,0.000253,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','servers',1,0.000293,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','server_cost',1,0.00029,NULL,NULL,NULL,'3041ab5b',6,'3041ab5b',6,'2017-07-18 08:25:33'),('mysql','tables_priv',1,0.000211,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','time_zone',1,0.000242,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','time_zone_leap_second',1,0.000329,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','time_zone_name',1,0.00027,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','time_zone_transition',1,0.000247,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','time_zone_transition_type',1,0.000237,NULL,NULL,NULL,'0',0,'0',0,'2017-07-18 08:25:33'),('mysql','user',1,0.000386,NULL,NULL,NULL,'ab6ccd20',2,'ab6ccd20',2,'2017-07-18 08:25:33'),('percona_test','checksums',1,0.000297,NULL,NULL,NULL,'d8b8e420',23,'d8b8e420',23,'2017-07-18 08:25:33'),('percona_test','load_data',1,0.000285,NULL,NULL,NULL,'42981178',1,'42981178',1,'2017-07-18 08:25:33'),('percona_test','sentinel',1,0.000294,NULL,NULL,NULL,'8bbdd2c',1,'8bbdd2c',1,'2017-07-18 08:25:33'),('sakila','actor',1,0.000411,NULL,NULL,NULL,'6816983c',200,'6816983c',200,'2017-07-18 08:25:33'),('sakila','address',1,0.001221,NULL,NULL,NULL,'ad975fe4',603,'ad975fe4',603,'2017-07-18 08:25:33'),('sakila','category',1,0.001169,NULL,NULL,NULL,'9c52e409',16,'9c52e409',16,'2017-07-18 08:25:33'),('sakila','city',1,0.002102,NULL,NULL,NULL,'4d700c4',600,'4d700c4',600,'2017-07-18 08:25:33'),('sakila','country',1,0.000379,NULL,NULL,NULL,'14ed8b59',109,'14ed8b59',109,'2017-07-18 08:25:33'),('sakila','customer',1,0.001379,NULL,NULL,NULL,'87c13eb5',599,'87c13eb5',599,'2017-07-18 08:25:33'),('sakila','film',1,0.012602,NULL,NULL,NULL,'bb27da2e',1000,'bb27da2e',1000,'2017-07-18 08:25:34'),('sakila','film_actor',1,0.01618,NULL,NULL,NULL,'5f42e2be',5462,'5f42e2be',5462,'2017-07-18 08:25:34'),('sakila','film_category',1,0.002104,NULL,NULL,NULL,'1ff3be9a',1000,'1ff3be9a',1000,'2017-07-18 08:25:34'),('sakila','film_text',1,0.005167,NULL,NULL,NULL,'8c094796',1000,'8c094796',1000,'2017-07-18 08:25:34'),('sakila','inventory',1,0.015794,NULL,NULL,NULL,'58102314',4581,'58102314',4581,'2017-07-18 08:25:34'),('sakila','language',1,0.000297,NULL,NULL,NULL,'4a5f0378',6,'4a5f0378',6,'2017-07-18 08:25:35'),('sakila','payment',1,0.024087,NULL,NULL,NULL,'4b712aa1',16049,'4b712aa1',16049,'2017-07-18 08:25:35'),('sakila','rental',1,0.045657,NULL,NULL,NULL,'a4aead4b',16044,'a4aead4b',16044,'2017-07-18 08:25:35'),('sakila','staff',1,0.001195,NULL,NULL,NULL,'5facaa32',2,'5facaa32',2,'2017-07-18 08:25:35'),('sakila','store',1,0.001001,NULL,NULL,NULL,'223743d9',2,'223743d9',2,'2017-07-18 08:25:35'),('sys','sys_config',1,0.000442,NULL,NULL,NULL,'82cc7288',6,'82cc7288',6,'2017-07-18 08:25:35'); +/*!40000 ALTER TABLE `checksums` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2017-07-18 5:27:15 diff --git a/t/pt-table-checksum/samples/char-chunk-ascii-explain.txt b/t/pt-table-checksum/samples/char-chunk-ascii-explain.txt index 6b038e14..d497a349 100644 --- a/t/pt-table-checksum/samples/char-chunk-ascii-explain.txt +++ b/t/pt-table-checksum/samples/char-chunk-ascii-explain.txt @@ -2,7 +2,7 @@ -- test.ascii -- -REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `i`, `c`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`ascii` FORCE INDEX(`c`) WHERE ((`c` >= ?)) AND ((`c` <= ?)) /*checksum chunk*/ +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `i`, convert(`c` using utf8mb4))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`ascii` FORCE INDEX(`c`) WHERE ((`c` >= ?)) AND ((`c` <= ?)) /*checksum chunk*/ REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `test`.`ascii` FORCE INDEX(`c`) WHERE ((`c` < ?)) ORDER BY `c` /*past lower chunk*/ diff --git a/t/pt-table-checksum/samples/chunkidx005.txt b/t/pt-table-checksum/samples/chunkidx005.txt index a6177f19..e4b0d417 100644 --- a/t/pt-table-checksum/samples/chunkidx005.txt +++ b/t/pt-table-checksum/samples/chunkidx005.txt @@ -2,7 +2,7 @@ -- sakila.city -- -REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `city_id`, `city`, `country_id`, UNIX_TIMESTAMP(`last_update`))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` >= ?)) AND ((`city_id` <= ?)) AND (country_id > 100) /*checksum chunk*/ +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `city_id`, convert(`city` using utf8mb4), `country_id`, UNIX_TIMESTAMP(`last_update`))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` >= ?)) AND ((`city_id` <= ?)) AND (country_id > 100) /*checksum chunk*/ REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `sakila`.`city` FORCE INDEX(`PRIMARY`) WHERE ((`city_id` < ?)) AND (country_id > 100) ORDER BY `city_id` /*past lower chunk*/ diff --git a/t/pt-table-checksum/samples/default-results-5.6.txt b/t/pt-table-checksum/samples/default-results-5.6.txt index d750354f..ed53ddf6 100644 --- a/t/pt-table-checksum/samples/default-results-5.6.txt +++ b/t/pt-table-checksum/samples/default-results-5.6.txt @@ -8,6 +8,8 @@ ERRORS DIFFS ROWS SKIPPED TABLE 0 0 1045 0 mysql.help_relation 0 0 529 0 mysql.help_topic 0 0 0 0 mysql.ndb_binlog_index +0 0 0 0 mysql.plugin +0 0 0 0 mysql.proc 0 0 0 0 mysql.procs_priv 0 0 2 0 mysql.proxies_priv 0 0 0 0 mysql.servers diff --git a/t/pt-table-checksum/samples/default-results-5.7.txt b/t/pt-table-checksum/samples/default-results-5.7.txt index 7e8648f4..244bd08a 100644 --- a/t/pt-table-checksum/samples/default-results-5.7.txt +++ b/t/pt-table-checksum/samples/default-results-5.7.txt @@ -4,12 +4,13 @@ ERRORS DIFFS ROWS SKIPPED TABLE 0 0 2 0 mysql.engine_cost 0 0 0 0 mysql.event 0 0 0 0 mysql.func -0 0 0 0 mysql.gtid_executed 0 0 40 0 mysql.help_category 0 0 682 0 mysql.help_keyword 0 0 1340 0 mysql.help_relation 0 0 637 0 mysql.help_topic 0 0 0 0 mysql.ndb_binlog_index +0 0 0 0 mysql.plugin +0 0 0 0 mysql.proc 0 0 0 0 mysql.procs_priv 0 0 0 0 mysql.proxies_priv 0 0 6 0 mysql.server_cost @@ -40,3 +41,4 @@ ERRORS DIFFS ROWS SKIPPED TABLE 0 0 16044 0 sakila.rental 0 0 2 0 sakila.staff 0 0 2 0 sakila.store +0 0 6 0 sys.sys_config diff --git a/t/pt-table-checksum/samples/dot.out b/t/pt-table-checksum/samples/dot.out index 003d2880..b7df5c73 100644 --- a/t/pt-table-checksum/samples/dot.out +++ b/t/pt-table-checksum/samples/dot.out @@ -2,7 +2,7 @@ -- test.t -- -REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `no.`, `foo.bar`, CONCAT(ISNULL(`foo.bar`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`t` FORCE INDEX(`PRIMARY`) WHERE ((`no.` >= ?)) AND ((`no.` <= ?)) /*checksum chunk*/ +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', convert(`no.` using utf8mb4), convert(`foo.bar` using utf8mb4), CONCAT(ISNULL(`foo.bar`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`t` FORCE INDEX(`PRIMARY`) WHERE ((`no.` >= ?)) AND ((`no.` <= ?)) /*checksum chunk*/ REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `test`.`t` FORCE INDEX(`PRIMARY`) WHERE ((`no.` < ?)) ORDER BY `no.` /*past lower chunk*/ diff --git a/t/pt-table-checksum/samples/oversize-chunks.txt b/t/pt-table-checksum/samples/oversize-chunks.txt index 21fcb183..3888ce25 100644 --- a/t/pt-table-checksum/samples/oversize-chunks.txt +++ b/t/pt-table-checksum/samples/oversize-chunks.txt @@ -2,7 +2,7 @@ -- osc.t2 -- -REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `c`, CONCAT(ISNULL(`c`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `osc`.`t2` FORCE INDEX(`c`) WHERE (((? IS NULL OR `c` >= ?))) AND (((? IS NULL OR `c` <= ?))) /*checksum chunk*/ +REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', convert(`c` using utf8mb4), CONCAT(ISNULL(`c`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `osc`.`t2` FORCE INDEX(`c`) WHERE (((? IS NULL OR `c` >= ?))) AND (((? IS NULL OR `c` <= ?))) /*checksum chunk*/ REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `osc`.`t2` FORCE INDEX(`c`) WHERE ((((? IS NOT NULL AND `c` IS NULL) OR (`c` < ?)))) ORDER BY `c` /*past lower chunk*/ diff --git a/t/pt-table-checksum/samples/pt-136.sql b/t/pt-table-checksum/samples/pt-136.sql new file mode 100644 index 00000000..1c259a71 --- /dev/null +++ b/t/pt-table-checksum/samples/pt-136.sql @@ -0,0 +1,6 @@ +CREATE DATABASE db1; +USE db1; +CREATE TABLE cp1251(f1 VARCHAR(100) CHARACTER SET LATIN1, f2 VARCHAR(100) CHARACTER SET CP1251) ENGINE=InnoDB; +SET NAMES UTF8; +INSERT INTO cp1251 VALUES('Sveta', 'Света'); + diff --git a/t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt b/t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt index ab7c9737..288000c1 100644 --- a/t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt +++ b/t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt @@ -8,6 +8,8 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE 0 0 1045 1 0 mysql.help_relation 0 0 529 1 0 mysql.help_topic 0 0 0 1 0 mysql.ndb_binlog_index +0 0 0 1 0 mysql.plugin +0 0 0 1 0 mysql.proc 0 0 0 1 0 mysql.procs_priv 0 0 2 1 0 mysql.proxies_priv 0 0 0 1 0 mysql.servers diff --git a/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt b/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt index f6755a93..3932c431 100644 --- a/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt +++ b/t/pt-table-checksum/samples/static-chunk-size-results-5.7.txt @@ -4,12 +4,13 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE 0 0 2 1 0 mysql.engine_cost 0 0 0 1 0 mysql.event 0 0 0 1 0 mysql.func -0 0 0 1 0 mysql.gtid_executed 0 0 40 1 0 mysql.help_category 0 0 682 1 0 mysql.help_keyword 0 0 1340 1 0 mysql.help_relation 0 0 637 1 0 mysql.help_topic 0 0 0 1 0 mysql.ndb_binlog_index +0 0 0 1 0 mysql.plugin +0 0 0 1 0 mysql.proc 0 0 0 1 0 mysql.procs_priv 0 0 0 1 0 mysql.proxies_priv 0 0 6 1 0 mysql.server_cost @@ -40,3 +41,4 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE 0 0 16044 19 0 sakila.rental 0 0 2 1 0 sakila.staff 0 0 2 1 0 sakila.store +0 0 6 1 0 sys.sys_config diff --git a/util/build-packages b/util/build-packages index be56159c..a26bb2b8 100755 --- a/util/build-packages +++ b/util/build-packages @@ -452,7 +452,6 @@ build_go_binaries() { fi fi echo "Building Go tools for $OS_ARCH ..." - go get -u github.com/kardianos/govendor cd $GO_TOOLS_DIR make $OS_ARCH cd $CUR_DIR diff --git a/util/check-dev-env b/util/check-dev-env index 81a6c22b..9bdf9ee8 100755 --- a/util/check-dev-env +++ b/util/check-dev-env @@ -41,7 +41,7 @@ my $exit_status = 0; my $fmt = "%-23s %8s\n"; # Not a module but we want to know the Perl version. -printf $fmt, "Perl", `perl -v | perl -ne '/v([\\d\\.]+)/ && print \$1'`, ""; +printf $fmt, "Perl", `perl -v | perl -ne '/v([\\d\\.]+)/ && print \$1'`; foreach my $module (@required_modules) { my $version = "NA";