Loading mysql-test/r/archive.result +98 −21 Original line number Diff line number Diff line Loading @@ -12433,31 +12433,108 @@ a b DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b char(12), b blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (32, "foo"); INSERT INTO t5 VALUES (23, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (3, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "We the people"); INSERT INTO t5 VALUES (NULL, "in order to form a more pefect union"); INSERT INTO t5 VALUES (NULL, "establish justice"); INSERT INTO t5 VALUES (NULL, "foo grok "); INSERT INTO t5 VALUES (32, "ensure domestic tranquility"); INSERT INTO t5 VALUES (23, "provide for the common defense"); INSERT INTO t5 VALUES (NULL, "fo fooo"); INSERT INTO t5 VALUES (NULL, "foo just naother bit of text"); INSERT INTO t5 VALUES (3, "foo this is mine to think about"); INSERT INTO t5 VALUES (NULL, "promote the general welfare"); SELECT * FROM t5; a b 1 foo 2 foo 3 foo 4 foo 5 foo 32 foo 23 foo 33 foo 34 foo 3 foo 35 foo 2 We the people 3 in order to form a more pefect union 4 establish justice 5 foo grok 32 ensure domestic tranquility 23 provide for the common defense 33 fo fooo 34 foo just naother bit of text 3 foo this is mine to think about 35 promote the general welfare SELECT b FROM t5; b foo We the people in order to form a more pefect union establish justice foo grok ensure domestic tranquility provide for the common defense fo fooo foo just naother bit of text foo this is mine to think about promote the general welfare SELECT b FROM t5 WHERE a =3; b in order to form a more pefect union foo this is mine to think about SELECT b FROM t5 WHERE a IN (32, 23, 5); b foo grok ensure domestic tranquility provide for the common defense DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b blob(12), c blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo", "grok this!"); INSERT INTO t5 VALUES (NULL, "We the people", NULL); INSERT INTO t5 VALUES (NULL, "in order to form a more peefect union", "secure the blessing of liberty"); INSERT INTO t5 VALUES (NULL, "establish justice", "to ourselves and"); INSERT INTO t5 VALUES (32, "ensure domestic tranquility", NULL); INSERT INTO t5 VALUES (23, "provide for the common defense", "posterity"); INSERT INTO t5 VALUES (NULL, "promote the general welfare", "do ordain"); SELECT * FROM t5; a b c 1 foo grok this! 2 We the people NULL 3 in order to form a more peefect union secure the blessing of liberty 4 establish justice to ourselves and 32 ensure domestic tranquility NULL 23 provide for the common defense posterity 33 promote the general welfare do ordain SELECT b FROM t5; b foo We the people in order to form a more peefect union establish justice ensure domestic tranquility provide for the common defense promote the general welfare SELECT b FROM t5 WHERE a =3; b in order to form a more peefect union SELECT b FROM t5 WHERE a IN (32, 23, 5); b ensure domestic tranquility provide for the common defense SELECT c FROM t5; c grok this! NULL secure the blessing of liberty to ourselves and NULL posterity do ordain SELECT c FROM t5 WHERE a =3; c secure the blessing of liberty SELECT c FROM t5 WHERE a IN (32, 23, 5); c NULL posterity drop table t1, t2, t4, t5; mysql-test/t/archive.test +41 −11 Original line number Diff line number Diff line Loading @@ -1409,22 +1409,52 @@ DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b char(12), b blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (32, "foo"); INSERT INTO t5 VALUES (23, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (3, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "We the people"); INSERT INTO t5 VALUES (NULL, "in order to form a more pefect union"); INSERT INTO t5 VALUES (NULL, "establish justice"); INSERT INTO t5 VALUES (NULL, "foo grok "); INSERT INTO t5 VALUES (32, "ensure domestic tranquility"); INSERT INTO t5 VALUES (23, "provide for the common defense"); INSERT INTO t5 VALUES (NULL, "fo fooo"); INSERT INTO t5 VALUES (NULL, "foo just naother bit of text"); INSERT INTO t5 VALUES (3, "foo this is mine to think about"); INSERT INTO t5 VALUES (NULL, "promote the general welfare"); SELECT * FROM t5; SELECT b FROM t5; SELECT b FROM t5 WHERE a =3; SELECT b FROM t5 WHERE a IN (32, 23, 5); #More blob tests DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b blob(12), c blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo", "grok this!"); INSERT INTO t5 VALUES (NULL, "We the people", NULL); INSERT INTO t5 VALUES (NULL, "in order to form a more peefect union", "secure the blessing of liberty"); INSERT INTO t5 VALUES (NULL, "establish justice", "to ourselves and"); INSERT INTO t5 VALUES (32, "ensure domestic tranquility", NULL); INSERT INTO t5 VALUES (23, "provide for the common defense", "posterity"); INSERT INTO t5 VALUES (NULL, "promote the general welfare", "do ordain"); SELECT * FROM t5; SELECT b FROM t5; SELECT b FROM t5 WHERE a =3; SELECT b FROM t5 WHERE a IN (32, 23, 5); SELECT c FROM t5; SELECT c FROM t5 WHERE a =3; SELECT c FROM t5 WHERE a IN (32, 23, 5); # # Cleanup, test is over Loading sql/ha_archive.cc +17 −6 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ handlerton archive_hton = { NULL, /* Start Consistent Snapshot */ NULL, /* Flush logs */ NULL, /* Show status */ NULL, /* Alter interface */ HTON_NO_FLAGS }; Loading Loading @@ -973,7 +974,10 @@ int ha_archive::get_row(azio_stream *file_to_read, byte *buf) for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ; ptr != end ; ptr++) { if (ha_get_bit_in_read_set(((Field_blob*) table->field[*ptr])->fieldnr)) total_blob_length += ((Field_blob*) table->field[*ptr])->get_length(); } /* Adjust our row buffer if we need be */ buffer.alloc(total_blob_length); Loading @@ -986,6 +990,8 @@ int ha_archive::get_row(azio_stream *file_to_read, byte *buf) { size_t size= ((Field_blob*) table->field[*ptr])->get_length(); if (size) { if (ha_get_bit_in_read_set(((Field_blob*) table->field[*ptr])->fieldnr)) { read= azread(file_to_read, last, size); if ((size_t) read != size) Loading @@ -993,6 +999,11 @@ int ha_archive::get_row(azio_stream *file_to_read, byte *buf) ((Field_blob*) table->field[*ptr])->set_ptr(size, last); last += size; } else { (void)azseek(file_to_read, size, SEEK_CUR); } } } DBUG_RETURN(0); } Loading Loading
mysql-test/r/archive.result +98 −21 Original line number Diff line number Diff line Loading @@ -12433,31 +12433,108 @@ a b DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b char(12), b blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (32, "foo"); INSERT INTO t5 VALUES (23, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (3, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "We the people"); INSERT INTO t5 VALUES (NULL, "in order to form a more pefect union"); INSERT INTO t5 VALUES (NULL, "establish justice"); INSERT INTO t5 VALUES (NULL, "foo grok "); INSERT INTO t5 VALUES (32, "ensure domestic tranquility"); INSERT INTO t5 VALUES (23, "provide for the common defense"); INSERT INTO t5 VALUES (NULL, "fo fooo"); INSERT INTO t5 VALUES (NULL, "foo just naother bit of text"); INSERT INTO t5 VALUES (3, "foo this is mine to think about"); INSERT INTO t5 VALUES (NULL, "promote the general welfare"); SELECT * FROM t5; a b 1 foo 2 foo 3 foo 4 foo 5 foo 32 foo 23 foo 33 foo 34 foo 3 foo 35 foo 2 We the people 3 in order to form a more pefect union 4 establish justice 5 foo grok 32 ensure domestic tranquility 23 provide for the common defense 33 fo fooo 34 foo just naother bit of text 3 foo this is mine to think about 35 promote the general welfare SELECT b FROM t5; b foo We the people in order to form a more pefect union establish justice foo grok ensure domestic tranquility provide for the common defense fo fooo foo just naother bit of text foo this is mine to think about promote the general welfare SELECT b FROM t5 WHERE a =3; b in order to form a more pefect union foo this is mine to think about SELECT b FROM t5 WHERE a IN (32, 23, 5); b foo grok ensure domestic tranquility provide for the common defense DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b blob(12), c blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo", "grok this!"); INSERT INTO t5 VALUES (NULL, "We the people", NULL); INSERT INTO t5 VALUES (NULL, "in order to form a more peefect union", "secure the blessing of liberty"); INSERT INTO t5 VALUES (NULL, "establish justice", "to ourselves and"); INSERT INTO t5 VALUES (32, "ensure domestic tranquility", NULL); INSERT INTO t5 VALUES (23, "provide for the common defense", "posterity"); INSERT INTO t5 VALUES (NULL, "promote the general welfare", "do ordain"); SELECT * FROM t5; a b c 1 foo grok this! 2 We the people NULL 3 in order to form a more peefect union secure the blessing of liberty 4 establish justice to ourselves and 32 ensure domestic tranquility NULL 23 provide for the common defense posterity 33 promote the general welfare do ordain SELECT b FROM t5; b foo We the people in order to form a more peefect union establish justice ensure domestic tranquility provide for the common defense promote the general welfare SELECT b FROM t5 WHERE a =3; b in order to form a more peefect union SELECT b FROM t5 WHERE a IN (32, 23, 5); b ensure domestic tranquility provide for the common defense SELECT c FROM t5; c grok this! NULL secure the blessing of liberty to ourselves and NULL posterity do ordain SELECT c FROM t5 WHERE a =3; c secure the blessing of liberty SELECT c FROM t5 WHERE a IN (32, 23, 5); c NULL posterity drop table t1, t2, t4, t5;
mysql-test/t/archive.test +41 −11 Original line number Diff line number Diff line Loading @@ -1409,22 +1409,52 @@ DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b char(12), b blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (32, "foo"); INSERT INTO t5 VALUES (23, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (3, "foo"); INSERT INTO t5 VALUES (NULL, "foo"); INSERT INTO t5 VALUES (NULL, "We the people"); INSERT INTO t5 VALUES (NULL, "in order to form a more pefect union"); INSERT INTO t5 VALUES (NULL, "establish justice"); INSERT INTO t5 VALUES (NULL, "foo grok "); INSERT INTO t5 VALUES (32, "ensure domestic tranquility"); INSERT INTO t5 VALUES (23, "provide for the common defense"); INSERT INTO t5 VALUES (NULL, "fo fooo"); INSERT INTO t5 VALUES (NULL, "foo just naother bit of text"); INSERT INTO t5 VALUES (3, "foo this is mine to think about"); INSERT INTO t5 VALUES (NULL, "promote the general welfare"); SELECT * FROM t5; SELECT b FROM t5; SELECT b FROM t5 WHERE a =3; SELECT b FROM t5 WHERE a IN (32, 23, 5); #More blob tests DROP TABLE t5; CREATE TABLE `t5` ( `a` int(11) NOT NULL auto_increment, b blob(12), c blob(12), KEY (`a`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; INSERT INTO t5 VALUES (NULL, "foo", "grok this!"); INSERT INTO t5 VALUES (NULL, "We the people", NULL); INSERT INTO t5 VALUES (NULL, "in order to form a more peefect union", "secure the blessing of liberty"); INSERT INTO t5 VALUES (NULL, "establish justice", "to ourselves and"); INSERT INTO t5 VALUES (32, "ensure domestic tranquility", NULL); INSERT INTO t5 VALUES (23, "provide for the common defense", "posterity"); INSERT INTO t5 VALUES (NULL, "promote the general welfare", "do ordain"); SELECT * FROM t5; SELECT b FROM t5; SELECT b FROM t5 WHERE a =3; SELECT b FROM t5 WHERE a IN (32, 23, 5); SELECT c FROM t5; SELECT c FROM t5 WHERE a =3; SELECT c FROM t5 WHERE a IN (32, 23, 5); # # Cleanup, test is over Loading
sql/ha_archive.cc +17 −6 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ handlerton archive_hton = { NULL, /* Start Consistent Snapshot */ NULL, /* Flush logs */ NULL, /* Show status */ NULL, /* Alter interface */ HTON_NO_FLAGS }; Loading Loading @@ -973,7 +974,10 @@ int ha_archive::get_row(azio_stream *file_to_read, byte *buf) for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ; ptr != end ; ptr++) { if (ha_get_bit_in_read_set(((Field_blob*) table->field[*ptr])->fieldnr)) total_blob_length += ((Field_blob*) table->field[*ptr])->get_length(); } /* Adjust our row buffer if we need be */ buffer.alloc(total_blob_length); Loading @@ -986,6 +990,8 @@ int ha_archive::get_row(azio_stream *file_to_read, byte *buf) { size_t size= ((Field_blob*) table->field[*ptr])->get_length(); if (size) { if (ha_get_bit_in_read_set(((Field_blob*) table->field[*ptr])->fieldnr)) { read= azread(file_to_read, last, size); if ((size_t) read != size) Loading @@ -993,6 +999,11 @@ int ha_archive::get_row(azio_stream *file_to_read, byte *buf) ((Field_blob*) table->field[*ptr])->set_ptr(size, last); last += size; } else { (void)azseek(file_to_read, size, SEEK_CUR); } } } DBUG_RETURN(0); } Loading