Skip to content

Commit 9d2e6b8

Browse files
author
stewart@willster.(none)
committed
BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables
allow handler::info to return an error code (that will be returned to the user)
1 parent 50ae5b7 commit 9d2e6b8

21 files changed

Lines changed: 53 additions & 35 deletions

sql/examples/ha_archive.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,15 +972,15 @@ int ha_archive::index_last(byte * buf)
972972
}
973973

974974

975-
void ha_archive::info(uint flag)
975+
int ha_archive::info(uint flag)
976976
{
977977
DBUG_ENTER("ha_archive::info");
978978

979979
/* This is a lie, but you don't want the optimizer to see zero or 1 */
980980
records= share->rows_recorded;
981981
deleted= 0;
982982

983-
DBUG_VOID_RETURN;
983+
DBUG_RETURN(0);
984984
}
985985

986986
int ha_archive::extra(enum ha_extra_function operation)

sql/examples/ha_archive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ha_archive: public handler
116116
int read_data_header(gzFile file_to_read);
117117
int write_data_header(gzFile file_to_write);
118118
void position(const byte *record);
119-
void info(uint);
119+
int info(uint);
120120
int extra(enum ha_extra_function operation);
121121
int reset(void);
122122
int external_lock(THD *thd, int lock_type);

sql/examples/ha_example.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ int ha_example::rnd_pos(byte * buf, byte *pos)
486486
sql_update.cc
487487
488488
*/
489-
void ha_example::info(uint flag)
489+
int ha_example::info(uint flag)
490490
{
491491
DBUG_ENTER("ha_example::info");
492-
DBUG_VOID_RETURN;
492+
DBUG_RETURN(0);
493493
}
494494

495495

sql/examples/ha_example.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class ha_example: public handler
138138
int rnd_next(byte *buf); //required
139139
int rnd_pos(byte * buf, byte *pos); //required
140140
void position(const byte *record); //required
141-
void info(uint); //required
141+
int info(uint); //required
142142

143143
int extra(enum ha_extra_function operation);
144144
int reset(void);

sql/examples/ha_tina.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,13 +683,13 @@ int ha_tina::rnd_pos(byte * buf, byte *pos)
683683
Currently this table handler doesn't implement most of the fields
684684
really needed. SHOW also makes use of this data
685685
*/
686-
void ha_tina::info(uint flag)
686+
int ha_tina::info(uint flag)
687687
{
688688
DBUG_ENTER("ha_tina::info");
689689
/* This is a lie, but you don't want the optimizer to see zero or 1 */
690690
if (records < 2)
691691
records= 2;
692-
DBUG_VOID_RETURN;
692+
DBUG_RETURN(0);
693693
}
694694

695695
/*

sql/examples/ha_tina.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class ha_tina: public handler
115115
int rnd_pos(byte * buf, byte *pos);
116116
int rnd_end();
117117
void position(const byte *record);
118-
void info(uint);
118+
int info(uint);
119119
int extra(enum ha_extra_function operation);
120120
int reset(void);
121121
int external_lock(THD *thd, int lock_type);

sql/ha_berkeley.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ void ha_berkeley::position(const byte *record)
17151715
}
17161716

17171717

1718-
void ha_berkeley::info(uint flag)
1718+
int ha_berkeley::info(uint flag)
17191719
{
17201720
DBUG_ENTER("ha_berkeley::info");
17211721
if (flag & HA_STATUS_VARIABLE)
@@ -1735,7 +1735,7 @@ void ha_berkeley::info(uint flag)
17351735
/* Don't return key if we got an error for the internal primary key */
17361736
if (flag & HA_STATUS_ERRKEY && last_dup_key < table->keys)
17371737
errkey= last_dup_key;
1738-
DBUG_VOID_RETURN;
1738+
DBUG_RETURN(0);
17391739
}
17401740

17411741

sql/ha_berkeley.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class ha_berkeley: public handler
127127
int rnd_next(byte *buf);
128128
int rnd_pos(byte * buf, byte *pos);
129129
void position(const byte *record);
130-
void info(uint);
130+
int info(uint);
131131
int extra(enum ha_extra_function operation);
132132
int reset(void);
133133
int external_lock(THD *thd, int lock_type);

sql/ha_heap.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ void ha_heap::position(const byte *record)
282282
*(HEAP_PTR*) ref= heap_position(file); // Ref is aligned
283283
}
284284

285-
void ha_heap::info(uint flag)
285+
int ha_heap::info(uint flag)
286286
{
287287
HEAPINFO info;
288288
(void) heap_info(file,&info,flag);
@@ -304,6 +304,7 @@ void ha_heap::info(uint flag)
304304
*/
305305
if (key_stat_version != file->s->key_stat_version)
306306
update_key_stats();
307+
return 0;
307308
}
308309

309310
int ha_heap::extra(enum ha_extra_function operation)

sql/ha_heap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ha_heap: public handler
8080
int rnd_next(byte *buf);
8181
int rnd_pos(byte * buf, byte *pos);
8282
void position(const byte *record);
83-
void info(uint);
83+
int info(uint);
8484
int extra(enum ha_extra_function operation);
8585
int external_lock(THD *thd, int lock_type);
8686
int delete_all_rows(void);

0 commit comments

Comments
 (0)