Skip to content

Commit 0e9a785

Browse files
author
Steinar H. Gunderson
committed
Merge branch 'mysql-5.6' into mysql-5.7
Change-Id: Ib163a015956275808cb39523a1469bbd53155a24
2 parents b3060e4 + 7e730bd commit 0e9a785

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sql/field.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2020, Oracle and/or its affiliates.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -9682,7 +9682,7 @@ uchar *Field_enum::pack(uchar *to, const uchar *from,
96829682
switch (packlength)
96839683
{
96849684
case 1:
9685-
*to = *from;
9685+
if (max_length > 0) *to = *from;
96869686
DBUG_RETURN(to + 1);
96879687
case 2: DBUG_RETURN(pack_int16(to, from, low_byte_first));
96889688
case 3: DBUG_RETURN(pack_int24(to, from, low_byte_first));

sql/field.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef FIELD_INCLUDED
22
#define FIELD_INCLUDED
33

4-
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License, version 2.0,
@@ -2074,7 +2074,7 @@ class Field_tiny :public Field_num {
20742074
virtual uchar *pack(uchar* to, const uchar *from,
20752075
uint max_length, bool low_byte_first)
20762076
{
2077-
*to= *from;
2077+
if (max_length > 0) *to= *from;
20782078
return to + 1;
20792079
}
20802080

0 commit comments

Comments
 (0)