C API row data not matching database data

2002-06-14 Thread Hihn Jason

I'm using the C API to return a record which has a field that contains
(somewhat) binary data. It's been properly mysql_escape_string()ed. I'm
using a 3.23.4x server  client.

When I do a: 
select data into outfile 'out' from table where id='1'; 
from the mysql client, I get what I expect in the outfile. 

When I do a mysql_fetch_row() and a row[0] on the same query from within the
C API, I get similar but completely different data. 

The former is ~1800 bytes long, and the latter ~6200 bytes long. 

Incidentally the data in the outfile contains a good number of the two char
sequence 0x91 0x11, but in the C program, it all comes out as 0xCD 

Anyway, at the end of the data is a plain text sequence that I am trying to
extract. I can find it ok, IF the data were there. The CAPI doesn't show it,
and that is my major problem. 

No 0x00s exist in the datastream. 

I'm really stuck, so I'd really appreciate any help! 

Thank you! 

PS. PHP returns the same thing as the C API.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Reconstructing SQL create table statements

2002-06-14 Thread Hihn Jason

I have a large number of tables that have been created through the years,
and I wish to obtain the SQL statements used to create them. I can go
through and do it all by hand, but that would take forever. Is there a way
to run a script against the database that will generate them for me? If it
misses the occasional additional index, then that is fine.

Thank you for your time.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Problems with UPDATE in v3.23.49 (is this a bug)

2002-04-05 Thread Hihn Jason

I have a table whose schema contains:
id INTEGER AUTO_INCREMENT, 
gen_time TIMESTAMP, 
rec_time TIMESTAMP, 
repeats INTEGER DEFAULT 0, 
PRIMARY KEY (id), 
INDEX (rec_time))

When I do an:
UPDATE table SET repeats=repeats+1

gen_time gets updated as well:
mysql select id, gen_time, rec_time, repeats from table;
++++-+
| id | gen_time   | rec_time   | repeats |
++++-+
|  1 | 20020404164500 | 20020405111308 |   0 |
++++-+
1 row in set (0.01 sec)

mysql update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql select id, gen_time, rec_time, repeats from table;
++++-+
| id | gen_time   | rec_time   | repeats |
++++-+
|  1 | 20020405112158 | 20020405111308 |   3 |
++++-+
1 row in set (0.02 sec)

Is this a bug or am I forgetting something?



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Problems with UPDATE in v3.23.49 (is this a bug)

2002-04-05 Thread Hihn Jason

Yes I did, but it is very long, and it was very long ago. 
Could someone please explain to me why this was done? It seems more
confusing to do this than to not do this. Why when you can just say SET
field=NOW() in the update statement would anyone build this auto update of
timestamps in? (the kicker is you HAVE to do it for all timestamps in a
schema past the first) Additionally, what if I wanted the time stamp format
(without formatting (spaces, colons, and dashes)) (which I do)

A very illogical feature I must say... Anyone agree with me?
(Forgive me Rick, I didn't hit reply to all)

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 11:34 AM
To: Hihn Jason; '[EMAIL PROTECTED]'
Subject: RE: Problems with UPDATE in v3.23.49 (is this a bug)


No, this is NOT a bug.

According to the manual (you read it, right?), TIMESTAMP is created so that
when a record is UPDATEd or INSERTed, the time of the change is entered into
the record.  If you want a date that does not changem use the DATE fiel

-Original Message-
From: Hihn Jason [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 10:33 AM
To: '[EMAIL PROTECTED]'
Subject: Problems with UPDATE in v3.23.49 (is this a bug)


I have a table whose schema contains:
id INTEGER AUTO_INCREMENT, 
gen_time TIMESTAMP, 
rec_time TIMESTAMP, 
repeats INTEGER DEFAULT 0, 
PRIMARY KEY (id), 
INDEX (rec_time))

When I do an:
UPDATE table SET repeats=repeats+1

gen_time gets updated as well:
mysql select id, gen_time, rec_time, repeats from table;
++++-+
| id | gen_time   | rec_time   | repeats |
++++-+
|  1 | 20020404164500 | 20020405111308 |   0 |
++++-+
1 row in set (0.01 sec)

mysql update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql select id, gen_time, rec_time, repeats from table;
++++-+
| id | gen_time   | rec_time   | repeats |
++++-+
|  1 | 20020405112158 | 20020405111308 |   3 |
++++-+
1 row in set (0.02 sec)

Is this a bug or am I forgetting something?



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php