From: Date: April 10 2006 6:56pm Subject: Re: getting table meta data (primary key, in this case) List-Archive: http://lists.mysql.com/internals/33508 Message-Id: <20060410165615.GY11975@w3.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Thv7PGoFpDPJ7Oar" --Thv7PGoFpDPJ7Oar Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. Yep. mistake there. > > 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(); > } Excellent! stuck this in a header: extern String Global_string; // call test->print(&Global_string); p Globa= l_string.c_ptr(); call Global_string.free() this in a .cc file: String Global_string; 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. > Regards, > Sergei >=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. --Thv7PGoFpDPJ7Oar 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) iQEVAwUBRDqOL5ZX2p1ccTnpAQIrEQf+IHxNIDDZrBTH+z0MaDuzG9B+1MmrhK/m /5If70uSvOxq4yd5OEGiUwAikjEhOfh/zrR0JV2RMfgcj5yFry+bvMbvTX004gg7 R/SbbywKmSTtDXJ2KYaHR3hjTvvx/SQDASbVJj7Why+ULzm74LTf3EByu2b4t4HO 5IU4BOOKTl/1eazbopN3sn6tMoaYS/pgKR76zDFHPim+8YTw5jwHnameG3Kp2fQs 8CJEjvwGZNLFFJhdprQm4Wphkpccvu/+njRzOoQY8v1eECXFHXp4KRgIOo0xS/0m VYE4BR+Pr7X+F9QeSqEzLQ5MpTxQnenKIT5E4cYSR2AX7MtkoHkqfQ== =qU/u -----END PGP SIGNATURE----- --Thv7PGoFpDPJ7Oar--