From: Warren Young Date: September 24 2004 10:28am Subject: Re: query.store, query.exec might yield in segmentation fault List-Archive: http://lists.mysql.com/plusplus/3521 Message-Id: <4153F6DC.3030408@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Jose Mortensen wrote: > > I know it should use exec instead, but: ...but you want to be able to misuse the library, and have it read your mind as to what you really meant, right? > 1. C++ code should never produce a segmentation fault. C++ code that does not contain bugs should never produce a segfault. Your code contains a bug. > 2. In some cases like, for example, a user console program where the > query is user defined, it is difficult to predict if the query should > return something or not. In cases like that better to return an empty > result. I think. So what you're saying is, you want me to write a SQL parser that can find out enough about the query that it can call exec() or store() depending on what kind of query it is...so you don't have to write one yourself. Is that right? There are two different APIs here because they are very different operations. That's necessary complexity, if we are to avoid writing a SQL parser. > My preference is to return an empty result. Patches thoughtfully considered.