From: Kristian Nielsen Date: October 15 2009 11:00am Subject: Re: String:c_ptr makes me unhappy List-Archive: http://lists.mysql.com/internals/37375 Message-Id: <87oco8q5v5.fsf@knielsen-hq.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Michael Widenius writes: > As far as I can remember, I haven't seen very, very few bugs in the > way String is used in MySQL becasue of c_ptr(). I think I have seen several bugs with this, where the buffer was allocated too short, so there was no room for the trailing '\n'. That also seems a good argument for not just eliminating all Valgrind warnings on this. In any case, I agree with Mark that this is a case where the code is too subtle, and very easy for developers to trip over. - Kristian.