From: Date: April 11 2006 1:44am Subject: Re: getting table meta data (primary key, in this case) List-Archive: http://lists.mysql.com/internals/33509 Message-Id: <20060410234420.GX412@w3.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s3mRlGd9ha2FBBsw" --s3mRlGd9ha2FBBsw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 10, 2006 at 12:56:15PM -0400, Eric Prud'hommeaux wrote: > On Mon, Apr 10, 2006 at 04:54:38PM +0200, Sergei Golubchik wrote: > > Hi! > >=20 > > First: please don't forget to cc: your questions to the list, > > so that others could benefit from the knowlegde share too. > > Also you can get faster replies, because more developers will see your > > question and will have their chance to answer. >=20 > Yep. mistake there. >=20 > > > Also, while i'm strolling around MySQL in gdb, are there any > > > toString-like methods to give a string representation of an > > > expression complile tree ala :? > > > p sel->where->as_string() > >=20 > > Item::print() > >=20 > > Though it uses String class, so I'm not sure you can call it from gdb > > the way you want. You can try the following workaround: > >=20 > > String gdb_print_buf; > > char *Item::gdb_print() > > { > > print(&gdb_print_buf); > > return gdb_print_buf.c_ptr(); > > } >=20 > Excellent! stuck this in a header: > extern String Global_string; // call test->print(&Global_string); p Glo= bal_string.c_ptr(); call Global_string.free() >=20 > this in a .cc file: > String Global_string; >=20 > and can call it repeatedly from gdb like so: > (gdb) call test->print(&Global_string) > (gdb) p Global_string.c_ptr() > $11 =3D 0x8df42a8 "(`Orders_0`.`id` =3D 2186)" > (gdb) call Global_string.free() > where test is some Item. used gdb's define command to create a shortcut function: (gdb) define pr >call $arg0->print(&Global_string) >p Global_string.c_ptr() >call Global_string.free() >end and tried it out: (gdb) pr(s) $19 =3D 0x8df4868 "`Orders_0`.`id`{?o}" > > Regards, > > Sergei > >=20 >=20 --=20 -eric office: +81.466.49.1170 W3C, Keio Research Institute at SFC, Shonan Fujisawa Campus, Keio University, 5322 Endo, Fujisawa, Kanagawa 252-8520 JAPAN +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA cell: +81.90.6533.3882 (eric@stripped) Feel free to forward this message to any list for any purpose other than email address distribution. --s3mRlGd9ha2FBBsw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iQEVAwUBRDrt1JZX2p1ccTnpAQIEFQgAirM/EzpfU2r5aZ1KVIlOUbIqp2CSkXEc 9GT9VMzWbs5xEYOCCRXtJg5Uqsdl5ZOvFSpXJ+FtOk6o1pbOgiz+6ByY3ljIuMgv 6adJg5SKh1VssUIQ/ynyQqUHFOesV0ts4KoWRZQ1WSsg4h0c6+VEoeZN9ANjF8ug N4dwW/77eXqD3lDrRTl5zomn9FcAv7UhpcvSpLz1R4dbqOFfVIXAi0tx2H9obyIZ 4KEGDHGyEi9tTrzWEc0u2ySNjY2NBa7u34wV0qTjUhPOTVXtKS93q+Ocunf0+Q66 SgZI6dHgKDNp3XGlICv2K/0zJhPtn0V/STfn7+dySLmNWiAkhxW9cA== =PZUg -----END PGP SIGNATURE----- --s3mRlGd9ha2FBBsw--