From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18758 invoked by alias); 19 Aug 2012 00:45:14 -0000 Received: (qmail 18741 invoked by uid 22791); 19 Aug 2012 00:45:12 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Aug 2012 00:44:58 +0000 From: "lirex.software at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54214] (corrected copyright notes in source file)please help to determine whether it is an PostgreSQL error or a GCC error (combobox and SQL data sorting) Date: Sun, 19 Aug 2012 00:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lirex.software at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg01256.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54214 Denis Kolesnik changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|DUPLICATE | --- Comment #14 from Denis Kolesnik 2012-08-19 00:44:57 UTC --- (In reply to comment #13) > This line contains a bug: > > strcpy(SQL1,"select id, ' ', regexp_replace(str_last_name,' ','') as lastname, > ' ', regexp_replace(str_first_name,' ','') as firstname, ' ', age(dt_birth) as > age from tbl_owners_individual;"); > > SQL1 only has capacity for 150 chars, but you write more than 170 to it. This > is a serious bug in your program (not in GCC or postgresql). > > When you use the "order by" clause you write even more characters to the array, > which is still a bug. > > Either learn to use dynamically-allocated memory or ensure your arrays are big > enough to hold the strings you write to them. > > This is the same issue as PR 54180 > > *** This bug has been marked as a duplicate of bug 54180 *** now my CHAR SQL1[350] as you see is 350 characters long, but the problem is the same: if I choose a filed from the combobox with the id 1 in the database table the second query, which also ends with the clause "...order by str_last_name..." returns the field with the id 111(if I remember correct), but should with 1.