~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_rsame.c

  • Committer: Jay Pipes
  • Date: 2008-12-18 15:55:03 UTC
  • mto: This revision was merged to the branch mainline in revision 717.
  • Revision ID: jpipes@serialcoder-20081218155503-u45ygyunrdyyvquq
Fix for Bug#308457.  Gave UTF8 enclosure and escape character on LOAD DATA INFILE and changed the error message to be more descriptive

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "myisam_priv.h"
 
16
#include "myisamdef.h"
17
17
#include <drizzled/util/test.h>
18
18
 
19
 
using namespace drizzled;
20
19
 
21
20
        /*
22
21
        ** Find current row with read on position or read on key
32
31
{
33
32
  if (inx != -1 && ! mi_is_key_active(info->s->state.key_map, inx))
34
33
  {
35
 
    return(errno=HA_ERR_WRONG_INDEX);
 
34
    return(my_errno=HA_ERR_WRONG_INDEX);
36
35
  }
37
36
  if (info->lastpos == HA_OFFSET_ERROR || info->update & HA_STATE_DELETED)
38
37
  {
39
 
    return(errno=HA_ERR_KEY_NOT_FOUND); /* No current record */
 
38
    return(my_errno=HA_ERR_KEY_NOT_FOUND);      /* No current record */
40
39
  }
41
40
  info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
42
41
 
43
42
  /* Read row from data file */
44
43
  if (fast_mi_readinfo(info))
45
 
    return(errno);
 
44
    return(my_errno);
46
45
 
47
46
  if (inx >= 0)
48
47
  {
49
48
    info->lastinx=inx;
50
49
    info->lastkey_length=_mi_make_key(info,(uint) inx,info->lastkey,record,
51
50
                                      info->lastpos);
 
51
    if (info->s->concurrent_insert)
 
52
      pthread_rwlock_rdlock(&info->s->key_root_lock[inx]);
52
53
    _mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
53
54
               SEARCH_SAME,
54
55
               info->s->state.key_root[inx]);
 
56
    if (info->s->concurrent_insert)
 
57
      pthread_rwlock_unlock(&info->s->key_root_lock[inx]);
55
58
  }
56
59
 
57
60
  if (!(*info->read_record)(info,info->lastpos,record))
58
61
    return(0);
59
 
  if (errno == HA_ERR_RECORD_DELETED)
60
 
    errno=HA_ERR_KEY_NOT_FOUND;
61
 
  return(errno);
 
62
  if (my_errno == HA_ERR_RECORD_DELETED)
 
63
    my_errno=HA_ERR_KEY_NOT_FOUND;
 
64
  return(my_errno);
62
65
} /* mi_rsame */