diff options
author | Guilhem Bichot <guilhem@mysql.com> | 2009-02-12 15:08:56 +0100 |
---|---|---|
committer | Guilhem Bichot <guilhem@mysql.com> | 2009-02-12 15:08:56 +0100 |
commit | 704b4845aa9ce51a6c5a9f5f42265e376db0dfb3 (patch) | |
tree | 73476f970c229f75846855edeeddfbc6fd87ed4b /sql/ha_partition.cc | |
parent | 2637dda66845868fe996e60e54996acf03f6c537 (diff) | |
parent | a5e5b0180a6b86cce258eef232ef59d6e7c40bb0 (diff) | |
download | mariadb-git-704b4845aa9ce51a6c5a9f5f42265e376db0dfb3.tar.gz |
merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.
There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.
mysys/thr_mutex.c:
adding DBUG_PRINT here, so that we can locate where the warning is issued.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index f9be3ffded6..e0bd3e6fb7e 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 MySQL AB +/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2818,6 +2818,36 @@ void ha_partition::unlock_row() DBUG_VOID_RETURN; } +/** + Check if semi consistent read was used + + SYNOPSIS + was_semi_consistent_read() + + RETURN VALUE + TRUE Previous read was a semi consistent read + FALSE Previous read was not a semi consistent read + + DESCRIPTION + See handler.h: + In an UPDATE or DELETE, if the row under the cursor was locked by another + transaction, and the engine used an optimistic read of the last + committed row value under the cursor, then the engine returns 1 from this + function. MySQL must NOT try to update this optimistic value. If the + optimistic value does not match the WHERE condition, MySQL can decide to + skip over this row. Currently only works for InnoDB. This can be used to + avoid unnecessary lock waits. + + If this method returns nonzero, it will also signal the storage + engine that the next read will be a locking re-read of the row. +*/ +bool ha_partition::was_semi_consistent_read() +{ + DBUG_ENTER("ha_partition::was_semi_consistent_read"); + DBUG_ASSERT(m_last_part < m_tot_parts && + bitmap_is_set(&(m_part_info->used_partitions), m_last_part)); + DBUG_RETURN(m_file[m_last_part]->was_semi_consistent_read()); +} /** Use semi consistent read if possible @@ -3432,7 +3462,7 @@ int ha_partition::rnd_next(uchar *buf) while (TRUE) { - int result= file->rnd_next(buf); + result= file->rnd_next(buf); if (!result) { m_last_part= part_id; @@ -4786,7 +4816,7 @@ int ha_partition::info(uint flag) /* Calculates statistical variables records: Estimate of number records in table - We report sum (always at least 2) + We report sum (always at least 2 if not empty) deleted: Estimate of number holes in the table due to deletes We report sum @@ -4825,13 +4855,13 @@ int ha_partition::info(uint flag) stats.check_time= file->stats.check_time; } } while (*(++file_array)); - if (stats.records < 2 && + if (stats.records && stats.records < 2 && !(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT)) stats.records= 2; if (stats.records > 0) stats.mean_rec_length= (ulong) (stats.data_file_length / stats.records); else - stats.mean_rec_length= 1; //? What should we set here + stats.mean_rec_length= 0; } if (flag & HA_STATUS_CONST) { |