undefined reference to `errno'

2003-12-14 Thread Bill Runge
Good morning list,
A rather brief introduction; I am new to this list and a novice to MySQL. I 
am in the process of building a postfix mailserver w/ mysql, courier, cyrus 
and others on a RH 9 distro. If hardware is a factor these items reside upon 
a intel pent 4, 3gig ram, and three scsi 120gig drives.
The issue at hand is what I believe to be with mysql. I passing args to 
postfix to include support for mysql works fine. When issuing the make 
command I get a nice little surprise that has kept me googling and searching 
through user lists for hours on end.
If someone could help me decipher the issue I would be greatly appreciative. 
I have included pertinent information for your review.

make -f Makefile.init makefiles \
'CCARGS=-DHAS_MYSQL -I/usr/include/mysql/ -DUSE_SASL_AUTH -
I/usr/local/include/sasl' \
'AUXLIBS=-L/usr/lib/mysql/ -l mysqlclient -lz -lm -L/usr/local/lib -lsasl2'

Then issue make

/usr/lib/mysql//libmysqlclient.a(my_malloc.o)(.text+0x23): In function 
`my_malloc':
: undefined reference to `errno'
/usr/lib/mysql//libmysqlclient.a(my_malloc.o)(.text+0xb3): In function 
`my_memdup':
: undefined reference to `errno'
/usr/lib/mysql//libmysqlclient.a(my_malloc.o)(.text+0x18e): In function 
`my_strdup':
: undefined reference to `errno'
/usr/lib/mysql//libmysqlclient.a(my_realloc.o)(.text+0x53): In function 
`my_realloc':
: undefined reference to `errno'
/usr/lib/mysql//libmysqlclient.a(my_lib.o)(.text+0x2c5): In function `my_dir':
: undefined reference to `errno'
/usr/lib/mysql//libmysqlclient.a(my_lib.o)(.text+0x399): more undefined 
references to `errno' follow
collect2: ld returned 1 exit status
make: *** [error] Error 1
make: *** [update] Error 1
This is the tail of the make output

Relevant apps that I have loaded on the server are as follows;
 mod_auth_mysql 1.11-12
 mysql 3.23.54a-11
 MySQL-devel 4.0.0-2
 mysql-server 3.23.54a-11
 perl-DBD-MySQL 2.1021-3
 php-mysql 4.2.2-17

Thank you,

--
Bill

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Duplicate combination

2003-12-14 Thread fr0g
I have a table with peoples names in 3 different languages.
Fields are like: id, surname_english, name_english, surname_original, 
name_original, surname_greek, name_greek.
What I want is to check if a person has been entered twice in that table.
The key is ID but I can't have any other field unique, as names and 
surnames are not unique.
I only want the combination of two fields of the same language to be unique.
How can I check this?
Any possible solution?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Duplicate combination

2003-12-14 Thread Aleksandar Bradaric
Hi,

 I have a table with peoples names in 3 different languages.
 Fields are like: id, surname_english, name_english, surname_original,
 name_original, surname_greek, name_greek.
 What I want is to check if a person has been entered twice in that table.
 The key is ID but I can't have any other field unique, as names and
 surnames are not unique.
 I only want the combination of two fields of the same language to be unique.
 How can I check this?
 Any possible solution?

You  can  always  define  an  UNIQUE  index  on the required
fields. Something like this:

mysql select * from nametest;
+++---++---+
| id | name_1 | surname_1 | name_2 | surname_2 |
+++---++---+
|  1 | A  | A | E  | T |
|  2 | B  | B | S  | F |
|  3 | C  | C | E  | T |
+++---++---+
3 rows in set (0.00 sec)

mysql alter table nametest add unique index sn1(name_1, surname_1);
Query OK, 3 rows affected (0.02 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql alter table nametest add unique index sn2(name_2, surname_2);
ERROR 1062: Duplicate entry 'E-T' for key 3

The  creation  of  the  first  index went OK as there are no
duplicate  entries.  The  second  one  reported  a duplicate
entry.  Once  created  these  indices  will not allow you to
enter duplicates.


Take care,
Aleksandar


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Duplicate combination

2003-12-14 Thread Chris Nolan
Hi!

There are many ways, depending on whether you want the database to 
handle it, or you want your application to handle it.

What you want is a UNIQUE index on surname_original and name_original. 
Assuming the table already exists:

ALTER TABLE names ADD UNIQUE(name_original,surname_original);

This will ensure that, for every row, the combination of name_original 
and surname_original is unique for the table, assuming that the table is 
called names.

To do it at the app level, you could either check before each insertion 
(no good unless you're willing to lock the table while you check for 
existance - not recommended) or add another column that contains a 
unique hash (a bit quicker in terms of database operations, but probably 
not as nice as the DB-side solution).

Hope this helps!

Regards,

Chris

fr0g wrote:

I have a table with peoples names in 3 different languages.
Fields are like: id, surname_english, name_english, surname_original, 
name_original, surname_greek, name_greek.
What I want is to check if a person has been entered twice in that table.
The key is ID but I can't have any other field unique, as names and 
surnames are not unique.
I only want the combination of two fields of the same language to be 
unique.
How can I check this?
Any possible solution?




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Documentation bug?

2003-12-14 Thread Chris Nolan
Hi all, while reading through some of the MySQL docs, I noticed the 
following paragraph:

|ALTER TABLE| works by making a temporary copy of the original table. 
The alteration is performed on the copy, then the original table is 
deleted and the new one is renamed. This is done in such a way that all 
updates are automatically redirected to the new table without any failed 
updates. While |ALTER TABLE| is executing, the original table is 
readable by other clients. Updates and writes to the table are stalled 
until the new table is ready.

This seems a bit confusing. On one hand, it says that updates don't 
fail, but on the other hand it says they are stalled until ALTER TABLE 
is done executing. Am I going blind/loosing my mind (a possibility I am 
open to) or do others agree with me?

Regards,

Chris

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Duplicate combination

2003-12-14 Thread Ivan Cukic (Foment)
fr0g wrote:
I have a table with peoples names in 3 different languages.
Fields are like: id, surname_english, name_english, surname_original, 
name_original, surname_greek, name_greek.
What I want is to check if a person has been entered twice in that table.
You can create unique index on (surname_english, name_english) and others...
UNIQUE KEY unique_key_name (surname_english, name_english)
			Ivan





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Documentation bug?

2003-12-14 Thread Jeremy Zawodny
On Mon, Dec 15, 2003 at 02:58:53AM +1100, Chris Nolan wrote:
 Hi all, while reading through some of the MySQL docs, I noticed the 
 following paragraph:
 
 |ALTER TABLE| works by making a temporary copy of the original table. 
 The alteration is performed on the copy, then the original table is 
 deleted and the new one is renamed. This is done in such a way that all 
 updates are automatically redirected to the new table without any failed 
 updates. While |ALTER TABLE| is executing, the original table is 
 readable by other clients. Updates and writes to the table are stalled 
 until the new table is ready.
 
 This seems a bit confusing. On one hand, it says that updates don't 
 fail, but on the other hand it says they are stalled until ALTER TABLE 
 is done executing. Am I going blind/loosing my mind (a possibility I am 
 open to) or do others agree with me?

What exactly is the discrepancy you see?  Can you be explicit?

The manual describes the way ALTER TABLE works accurately.

Jeremy
-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
[EMAIL PROTECTED]  |  http://jeremy.zawodny.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Help with JOIN and Record Display

2003-12-14 Thread Hunter, Jess
This being the first time I have tried to do a JOIN statement (and still not
yet fully understanding it). If someone could take a look at the below code
and see what I may be doing wrong.

I have the actual code working and it displays the information from
$TableName2.notes, however in this table there are three records that are
being displayed (which it should) however it displays them all together.
i.e.

DISPLAYED
This is the first record This is the second record This is the thirdrecord
/DISPLAYED

What I am wanting it to do is:

DISPLAYED
This is the first record 
This is the second record
This is the thirdrecord
/DISPLAYED

Here is the code I am using

SNIPPET
$Link = mysql_connect($Host, $User, $Password);
$Query=SELECT * from $TableName1 LEFT JOIN $TableName2 ON ($TableName1.id =
$TableName2.id) WHERE $TableName1.id=1;
$Result= mysql_db_query ($DBName, $Query, $Link);

while ($Row = mysql_fetch_array ($Result)){
print ($Row[notes]);
}

/SNIPPET

I have even tried putting a line break (\n) in at the end of the $Row[notes]
to see if that would do anything which it did not.

Thanks in advance for any possible assistance

Jess


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: RESOLVED - Help with JOIN and Record Display

2003-12-14 Thread Hunter, Jess
I managed to figure out where I was going wrong (or at least I think I have.
I was playing around with the syntax and decided to add a BR after the
$Row[notes] and it displayed the  records line by line. I don't know if this
was the best way to do it but it worked.

Thanks

Jess

 -Original Message-
 From: Hunter, Jess [SMTP:[EMAIL PROTECTED]
 Sent: Sunday, December 14, 2003 11:34 AM
 To:   [EMAIL PROTECTED]
 Subject:  Help with JOIN and Record Display
 
 This being the first time I have tried to do a JOIN statement (and still
 not
 yet fully understanding it). If someone could take a look at the below
 code
 and see what I may be doing wrong.
 
 I have the actual code working and it displays the information from
 $TableName2.notes, however in this table there are three records that are
 being displayed (which it should) however it displays them all together.
 i.e.
 
 DISPLAYED
 This is the first record This is the second record This is the thirdrecord
 /DISPLAYED
 
 What I am wanting it to do is:
 
 DISPLAYED
 This is the first record 
 This is the second record
 This is the thirdrecord
 /DISPLAYED
 
 Here is the code I am using
 
 SNIPPET
 $Link = mysql_connect($Host, $User, $Password);
 $Query=SELECT * from $TableName1 LEFT JOIN $TableName2 ON ($TableName1.id
 =
 $TableName2.id) WHERE $TableName1.id=1;
 $Result= mysql_db_query ($DBName, $Query, $Link);
 
 while ($Row = mysql_fetch_array ($Result)){
 print ($Row[notes]);
 }
 
 /SNIPPET
 
 I have even tried putting a line break (\n) in at the end of the
 $Row[notes]
 to see if that would do anything which it did not.
 
 Thanks in advance for any possible assistance
 
 Jess
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
  
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
  
 
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



problem with query (group, count)

2003-12-14 Thread Agachi Valentin
Hello to all,

I searched this list's archive, but I couldn't find a solution to a problem 
I am currently facing.
Any help would be appreciated.

I have the next table configuration: session (an session id), weight (a 
counter), and other fields.
When I add a new record and the session id I am tring to add doesn't exist 
in the table, the
weight field is set to 1, other wise the weight field is set to the maximum 
weight field + 1 found
for the same session id.

The problem: I want a query to get all the distinct session ids, but for 
each session id I want it
to return the last record in the order of the weight field.

I tried the following query:

select *, count(*) as cnt from table group by session having weight=cnt

But the problem is HAVING is applied after the grouping. I want my condition 
(weight=cnt) to
be processed before the grouping. I can't add it in the Where clause because 
of cnt.

How can I do this ?

Valentin Agachi

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Another Brickwall with Displaying using JOIN

2003-12-14 Thread Hunter, Jess
OK, Have another small issue that maybe someone could help me out with.

When using a JOIN I can pull records from a second table without a problem
(now).

I am wanting to display two fields ( id and notes) however I only want the
id field to display once and all the notes to be displayed.

Here is the syntax I am trying to use:

SNIPPET

$Query=SELECT * from $TableName2 LEFT JOIN $TableName1 ON ($TableName2.id =
$TableName1.id) WHERE $TableName2.initials='jlh';
$Result= mysql_db_query ($DBName, $Query, $Link);

while ($Row = mysql_fetch_array ($Result)){
print (ID: $Row[id] - $Row[technotes]BR\n);
}
/SNIPPET
Which produces this display

ID: 1 - This is the first record
ID: 1 - This is the second record
ID: 1 - This is the third record

In the end I want to have it displayed as such:

ID: 1
This is the first record
This is the second record
This is the third record

Any and all help would be appreciated

Jess

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Documentation bug?

2003-12-14 Thread Chuck Gadd
Chris Nolan wrote:

This seems a bit confusing. On one hand, it says that updates don't 
fail, but on the other hand it says they are stalled until ALTER TABLE 
is done executing. Am I going blind/loosing my mind (a possibility I am 
open to) or do others agree with me?
It looks perfectly correct.   They are stalled, in other words, the
queries will be forced to wait.  They won't fail, they will simply
not complete until the ALTER TABLE is done.




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Another Brickwall with Displaying using JOIN

2003-12-14 Thread Bob Loeffler
Hi Jess,

If there will never be another ID number, something like the following
should work (although I don't know about the BR\n part):

SNIPPET

$Row = mysql_fetch_array ($Result);
print (ID: $Row[id]BR\n);
print ($Row[technotes]BR\n);

while ($Row = mysql_fetch_array ($Result))
{
print ($Row[technotes]BR\n);
}

/SNIPPET

But, if there is the possibility that there could be more than one ID
number, you would want to compare the ID with the previous ID. If they are
different, you would need to print the new ID and then its technotes. Try
this:

SNIPPET

$Row = mysql_fetch_array ($Result);
$tempid = $Row[id];

print (ID: $Row[id]BR\n);
print ($Row[technotes]BR\n);

while ($Row = mysql_fetch_array ($Result))
{
if ($Row[id] == $tempid)
{
print ($Row[technotes]BR\n);
}
else
{
print (BR\n);
print (ID: $Row[id]BR\n);
print ($Row[technotes]BR\n);
$tempid = $Row[id];
}
}

/SNIPPET

Bob


-Original Message-
From: Hunter, Jess [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 11:02 AM
To: [EMAIL PROTECTED]
Subject: Another Brickwall with Displaying using JOIN


OK, Have another small issue that maybe someone could help me out with.

When using a JOIN I can pull records from a second table without a problem
(now).

I am wanting to display two fields ( id and notes) however I only want the
id field to display once and all the notes to be displayed.

Here is the syntax I am trying to use:

SNIPPET

$Query=SELECT * from $TableName2 LEFT JOIN $TableName1 ON ($TableName2.id =
$TableName1.id) WHERE $TableName2.initials='jlh';
$Result= mysql_db_query ($DBName, $Query, $Link);

while ($Row = mysql_fetch_array ($Result)){
print (ID: $Row[id] - $Row[technotes]BR\n);
}
/SNIPPET
Which produces this display

ID: 1 - This is the first record
ID: 1 - This is the second record
ID: 1 - This is the third record

In the end I want to have it displayed as such:

ID: 1
This is the first record
This is the second record
This is the third record

Any and all help would be appreciated

Jess

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysql-4.1.1-alpha-win.zip - Missing setup file

2003-12-14 Thread hotmail
Clear DayEvening, 

No setup file is included in the ZIP mysql-4.1.1-alpha-win.zip 

Do you know why ??

Cheers
Mark



Questions about indexing

2003-12-14 Thread Dan Anderson

I have a database I'm using  for a MMORPG (well, it isn't very
MM because I'm something of a  noob), and I have a few questions about
indexing.  I  am storing world data  in a database.  In  order to keep
everything as  swift as  possible, I have  indexed everything.   And I
really mean, everything -- a few dozen columns on a half dozen tables.

My question  is, is this the  right way?  I  figure that since
the world  data won't  be changed  very often (once  I design  the map
that's going  to be it) the  increased time for  INSERTS won't matter,
because SELECTs  will be  very speedy.  But  I wanted to  double check
with this group  because the mySQL manual says that  a large number of
disk seeks will be *slower* with indexing than without.  I assume this
means INSERTs because INSERTs have to  be in order, and that since the
world data is only a few megs it won't be seeking at all but in RAM. 

 Am I right?  I'd appreciate any comments.

Thanks in advance,

-Dan


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: undefined reference to `errno'

2003-12-14 Thread Jeff Gordon
On Sun, Dec 14, 2003 at 02:28:36AM -0600, Bill Runge wrote:
 
 Then issue make
 
 /usr/lib/mysql//libmysqlclient.a(my_malloc.o)(.text+0x23): In function 
 `my_malloc':
 : undefined reference to `errno'

 collect2: ld returned 1 exit status
 make: *** [error] Error 1
 make: *** [update] Error 1

(Hi, Bill.)  I might be talkin' through my hat, here, but this is very
similar to problems being encountered with compiling Bernstein's
software items, qmail, ucspi-tcp, daemontools, et al.

In the case of those software items, the problem arises from a
difference in specification of the _newest_ gcc and libraries.

I don't 'speak' C/gcc, but I gather the source had been coded to make
direct use of 'errorno.h', and newest gcc considers that a no-no.  Your
error message is undefined reference to 'errno', which is not the
same error message I've seen when compiling the Bernstein items, but
thought I should mention this anomaly in case it applies to your
situation, somehow.

-- 

 -- Jeff --   http://www.wellnow.com

 There's nothing left in the world to prove.  All that's worth doing
  is to love one another, using whatever means are available to serve.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



MySQL or MaxDB or PostgreSQL or Interbase/Firebird or ?

2003-12-14 Thread Jerry Apfelbaum
Hello.
 
I have been tasked with evaluating open source databases for a large
upcoming project:  e-commerce, B2B, high availability.
 
The O/S is most likely to be Linux, although FreeBSD could possibly be used
(lower probability).
 
So far, it seems that MySQL, MaxDB, PostgreSQL, and Interbase/Firebird are
possible candidates.
 
Does anyone know why we should or should not use any of these?  Does anyone
know of other possibilities?
 
I’d very much appreciate hearing your comments and recommendations.
 
I have only recently started these evaluations.  BTW, my own background is
from the Oracle DBA world.
 
MySQL is certainly popular and seems to have very good performance, but I am
concerned that the lack of Triggers, Stored Procedures, User-Defined
Functions, and Views (to a lesser degree ) will be a disadvantage.
 
MaxDB appears to be more feature-rich and possibly more
industrial-strength.  How does its performance and stability compare to the
others?
 
Many Thanks.
Jerry Apfelbaum
Toronto
 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Using MySQL in LGPL library

2003-12-14 Thread Rodrigo Moya
Hi

We have been supporting MySQL in the GNOME-DB project
(http://www.gnome-db.org) since the beginning almost (1998). GNOME-DB
provides several liraries, and one of those is a plugin-based generic
data access library (libgda) which allows access to several DBMS, by
dlopen'ing the plugins. Each of those plugins provide access to a
specific RDBMS.

The library (libgda) is LGPL, so it seems we are not able to have it
link against the GPL version of MySQL.

So, we have been thinking about what to do, and so far we only see 3
possibilities:

* force libgda to link against the LGPL MySQL libraries, but I suppose
there won't be any 4.x LGPL libraries, right?
* have the MySQL plugin communicate with the library via local
sockets/message queues/whatever so that we don't link to it directly.
* completely remove support for MySQL, which, for obvious reasons, we'd
prefer to avoid.

So far, we have disabled MySQL access in the CVS version until we know
what to do.

Do you have any advice on what to do? What are other GPL-incompatible
projects doing?

[Please CC me since I'm not on the list]

cheers


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Documentation bug?

2003-12-14 Thread Paul DuBois
At 2:58 +1100 12/15/03, Chris Nolan wrote:
Hi all, while reading through some of the MySQL docs, I noticed the 
following paragraph:

|ALTER TABLE| works by making a temporary copy of the original 
table. The alteration is performed on the copy, then the original 
table is deleted and the new one is renamed. This is done in such a 
way that all updates are automatically redirected to the new table 
without any failed updates. While |ALTER TABLE| is executing, the 
original table is readable by other clients. Updates and writes to 
the table are stalled until the new table is ready.

This seems a bit confusing. On one hand, it says that updates don't 
fail, but on the other hand it says they are stalled until ALTER 
TABLE is done executing. Am I going blind/loosing my mind (a 
possibility I am open to) or do others agree with me?
Agree with you in what way?  You haven't pointed out any contradiction
or inconsistency, so it's not readily apparent what you consider the
problem to be.
Updates are stalled while the ALTER TABLE operation is in progress,
then they are processed.  An update stalling is not the same as an
update failing.  Stalling just means delayed a bit.
Regards,

Chris


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Problems using date with MySQL 4.1.0 - Alpha

2003-12-14 Thread Lenny Sorey
I am currently using MySQL 4.1 Win2K version along ODBC 3.5.1 Driver

I am having trouble using the following LOAD DATA INFILE to import a txt, comma 
delimited file into to a Mysql Table.

Actually the only problem is the date field loading into mysql 4.1.

I have defined the field as a date, datetime and timestamp. 

Where I am having trouble is the date in the second group below. I am receiving the 
information as 
12/06/2003.  All fields load fine with the exception of the 12/06/2003 field.

All I get is is -00-00 00:00:00 for the value of this field.

Can anyone point me to the right direction on how I can successfully load the date 
with the 12/06/2003 format without
getting -00-00 00:00:00 everytime.

Thanks for your help and time.

Lenny Sorey



LOAD DATA INFILE d:/mydir/myfile.Tmp INTO TABLE dealervehicle
FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n';
(CIDLOTD,CVIN,CSTOCKNUM,CDISPOSITI,CMAKE,CMODEL,CYEAR,CMILEAGE,CBODYTYPE,CENGINE,CENGINESIZ,CINDUCTION,CTRANSMISS,
CCOLOR,CPRICE,CCOST,CWARRANTY,CWARRANTYT,FWARRANTY,FWARRANTYT,FWARRANTYC,CPC_LABOR,CPC_PARTS,CWARRMONTH,C
WARRMILES,CMANUF_MON,CMANUF_YEA,CSERVICEAG,DDATE_IN,DDATE_REMO,O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O1
6,O17,O18,O19,O20,O21,O22,O23,O24,O25,O26,O27,O28,O29,O30,O31,O32,O33,O34,O35);




Dealer Name,2FMZA5145YBC70950,6641,A,FORD,Windstar LX,2000,65969,MINI 
VAN,V-6,3.8,SEQUENTIAL-PORT 
F.I.,AUTOMATIC WITH OVERDRIVE,Red, , ,Y,L,C1, , 
,50,50,90,3000,08,1999,Y,12/06/2003,/  /,POWER 
STEERING,POWER BRAKES,POWER DOOR LOCKS,POWER WINDOWS,AM/FM STEREO 
RADIO,CASSETTE PLAYER,RADIAL 
TIRES,GAUGE CLUSTER,TRIP ODOMETER,TACHOMETER,AIR CONDITIONING,TILT STEERING 
WHEEL,CRUISE 
CONTROL,TINTED GLASS,DRIVER SIDE AIR BAG,PASSENGER SIDE AIR BAG,RECLINING 
SEATS,,ALLOY WHEELS,BODY-SIDE 
MOLDING,LUGGAGE RACK,CLOCK,INTERVAL WIPERS,REAR DEFROSTER,REAR WINDOW 
WIPER,CONSOLE,CARPETING,DAY/NIGHT LEVER,DUAL SPORT MIRRORS,DRIVER SIDE 
REMOTE MIRROR,FRONT BUCKET 
SEATS,CLOTH UPHOLSTERY,THIRD SEAT,CENTER ARM REST,COURTESY LIGHTS







-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: undefined reference to `errno'

2003-12-14 Thread Martin Gainty
the reference is found in the source..

from crt.c
#include errno.h

Regards,
-Martin

- Original Message - 
From: Jeff Gordon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 3:57 PM
Subject: Re: undefined reference to `errno'


 On Sun, Dec 14, 2003 at 02:28:36AM -0600, Bill Runge wrote:
  
  Then issue make
  
  /usr/lib/mysql//libmysqlclient.a(my_malloc.o)(.text+0x23): In function 
  `my_malloc':
  : undefined reference to `errno'
 
  collect2: ld returned 1 exit status
  make: *** [error] Error 1
  make: *** [update] Error 1
 
 (Hi, Bill.)  I might be talkin' through my hat, here, but this is very
 similar to problems being encountered with compiling Bernstein's
 software items, qmail, ucspi-tcp, daemontools, et al.
 
 In the case of those software items, the problem arises from a
 difference in specification of the _newest_ gcc and libraries.
 
 I don't 'speak' C/gcc, but I gather the source had been coded to make
 direct use of 'errorno.h', and newest gcc considers that a no-no.  Your
 error message is undefined reference to 'errno', which is not the
 same error message I've seen when compiling the Bernstein items, but
 thought I should mention this anomaly in case it applies to your
 situation, somehow.
 
 -- 
 
  -- Jeff --   http://www.wellnow.com
 
  There's nothing left in the world to prove.  All that's worth doing
   is to love one another, using whatever means are available to serve.
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql-4.1.1-alpha-win.zip - Missing setup file

2003-12-14 Thread Mike

No setup file is included in the ZIP mysql-4.1.1-alpha-win.zip 
Do you know why ??

It is alpha software, expect an installer with the final version. In the meantime just 
extract the zip file into a directory and it should run.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



blocked database by the server

2003-12-14 Thread Oscar Orellana
Hi, everyone!

I'm a new user in MySQL. I've got a problem: The server told me that the database is 
blocked because of many bad connections. It needs to be unblocked. May I do that from 
my computer or it has to be done from the server?

If there are users who speak Spanish, please send me a mail. I don't speak English 
well.

Thanks
Oscar Orellana



My SQL setup issue

2003-12-14 Thread Will5W
Hello,

I am unable to start MySQL 4.0.  I tried installing it from a mirro image.  All looks 
OK, but when I try to initiate it, I reveive ERROR moving data -103 server.  Then I 
initiate WinMySQLAdmin and I believe I am supposed to be prompted for Name and 
Password.  I actually get a window with several tabs across the top of screen; 
Environment, Start Check, Server, My .ini Setup, Err File. but no login.

Am I doing something wrong?

Thank you.

William

__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Getting Records where date is LESS THAN today, AND...

2003-12-14 Thread Richard
I am Creating a newsletter site for my employer, which will allow him to just add the 
newsletter and choose which day to mail it. a cron job runs everynight and mails out a 
notice that the newsletter is ready, along with the link.

I am having a problem getting the date to match up...

I have these 'columns'...

sendoutmon is the MONTH that it will or did get sent out. For example:  12
sendoutday is the DAY of the month it will or did get sent out. For example: 14
sendoutyear is the YEAR that it will or did get sent out. For example 2003
sent Which is an enum, of either 0 or 1. 0 being NOT sent yet. 1 being already sent
archive Which is telling us if we want it added to the archive or not. so it's an enum 
like sent

So I'm trying to Call the records into my Perl Application, which does it like this...

my $dbh = Sess::Eco::connect();
my $sth = $dbh-prepare (qq{ SELECT * FROM newsletters WHERE archive  = 1 AND sent = ? 
AND sendoutmon = $_current_month AND sendoutday = $_current_day AND sendoutyear = 
$_current_year });
$sth-execute(1);
my $_actual_rows = $dbh-selectrow_array(qq{SELECT COUNT(*) FROM newsletters WHERE 
archive  = 1 AND sent = 1 AND sendoutmon = $_current_month AND sendoutday = 
$_current_day AND sendoutyear = $_current_year});
while ($row = $sth-fetchrow_hashref()) {
#Print my table records...
}
$sth-finish();

That is not working like it should... I have put 3 testing newsletters into the 
database.
1 with these values: (among other irrelevant ones)

sendoutmonsendoutday sendoutyear  archive  sent
11   15  2003 1   1
12   13  2003 1   1
12   15  2003 1   0

So with THOSE 3, test newsletters, 2 of them SHOULD be displayed. But ONLY the middle 
one is printed into my table.

I think I'm doing it the totally wrong way.
For instance, if one of the newsletters was last year, then it would not be correct, 
such as this...
If today was January 1, 2004 then none of those would be displayed, because the month 
and the Day would not be
less then the sendoutmon or sendoutday.

So, how can I do this?
In the Admin menu I created for him, when he chooses when to send it, then it uses a 
calander where he can
choose a date, which is formated like this: mm/dd/ So I have it check to make sure 
it's in the future, but
not to distant future.

Is there a BETTER way to do this? I know there is, but can someone give me an example?
I want to do it right now, instead of finish this project, then have to go re-code 
half the scripts/databases.

Thank you in advance for any tips/advice you have.
Richard
FRHweb


Re: Problems using date with MySQL 4.1.0 - Alpha

2003-12-14 Thread Paul DuBois
At 18:10 -0600 12/14/03, Lenny Sorey wrote:
I am currently using MySQL 4.1 Win2K version along ODBC 3.5.1 Driver

I am having trouble using the following LOAD DATA INFILE to import a 
txt, comma delimited file into to a Mysql Table.

Actually the only problem is the date field loading into mysql 4.1.

I have defined the field as a date, datetime and timestamp.

Where I am having trouble is the date in the second group below. I 
am receiving the information as
12/06/2003.  All fields load fine with the exception of the 
12/06/2003 field.
MySQL expects dates to be formatted in year-month-day order.  If you
check the values that you think loaded successfully, my guess is that you
will find they didn't really.
All I get is is -00-00 00:00:00 for the value of this field.

Can anyone point me to the right direction on how I can successfully 
load the date with the 12/06/2003 format without
getting -00-00 00:00:00 everytime.

Thanks for your help and time.

Lenny Sorey


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: blocked database by the server

2003-12-14 Thread Paul DuBois
At 19:41 -0500 12/14/03, Oscar Orellana wrote:
Hi, everyone!

I'm a new user in MySQL. I've got a problem: The server told me that 
the database is blocked because of many bad connections. It needs to 
be unblocked. May I do that from my computer or it has to be done 
from the server?
I am guessing, but it sounds as though you may need to issue a FLUSH HOSTS
statement.  Check this section in the manual:
http://www.mysql.com/doc/en/Blocked_host.html


If there are users who speak Spanish, please send me a mail. I don't 
speak English well.

Thanks
Oscar Orellana


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: foreign keys.

2003-12-14 Thread Paul DuBois
At 11:09 +1030 12/15/03, Mofeed Shahin wrote:
I'm trying to create a bunch of tables in MySQL. I'm having problems creating
the following table :
CREATE TABLE foo(
ID INT PRIMARY KEY,
note VARCHAR(50),
FOO_ID INT,
FOREIGN KEY (FOO_ID) REFERENCES foo(ID)
) TYPE=INNODB;
The error I get is the following :
ERROR 1005: Can't create table './moftest/foo.frm' (errno: 150)
I found out that errno 150 means that it didn't like the Foreign key
constraint.
Does MySQL not support this type of Foreign Key constraint ?
If does.  However, a foreign key must be indexed, and you have declared
no index on FOO_ID.  Try this:
CREATE TABLE foo(
ID INT PRIMARY KEY,
note VARCHAR(50),
FOO_ID INT,
INDEX (FOO_ID),
FOREIGN KEY (FOO_ID) REFERENCES foo(ID)
) TYPE=INNODB;
--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


integer not being inserted correctly

2003-12-14 Thread A Pasetti
When attempting to insert an integer into an integer
column, a different value is being inserted for the
given row. Check out the sql below to see what I mean.
The integer 7819359281 is somehow changed to
2147483647 when it's inserted.

Perhaps someone has experienced this problem and could
suggest a fix. I'm using MySQL 4.0.

Your advice will be greatly appereciated.

Thanks,

Andrew Pasetti

*SQL QUERY RESULTS BELOW*

mysql create table TmpPhoneNumbers
- (
- token char(12) not null,
- number int(12) primary key
- );
Query OK, 0 rows affected (0.05 sec)

mysql insert into TmpPhoneNumbers (token,number)
values ('dabw6pz6zkbc',7819359281);
Query OK, 1 row affected (0.05 sec)

mysql select * from TmpPhoneNumbers;
+--++
| token| number |
+--++
| dabw6pz6zkbc | 2147483647 |
+--++
1 row in set (1.06 sec)

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: integer not being inserted correctly

2003-12-14 Thread Dan Nelson
In the last episode (Dec 14), A Pasetti said:
 When attempting to insert an integer into an integer column, a
 different value is being inserted for the given row. Check out the
 sql below to see what I mean. The integer 7819359281 is somehow
 changed to 2147483647 when it's inserted.
 
 Perhaps someone has experienced this problem and could suggest a fix.
 I'm using MySQL 4.0.

Use a larger numeric type.  

http://www.mysql.com/doc/en/Numeric_types.html

Type  Bytes From To

TINYINT   1 -128 127
SMALLINT  2 -32768   32767
MEDIUMINT 3 -8388608 8388607
INT   4 -2147483648  2147483647
BIGINT8 -9223372036854775808 9223372036854775807
 
-- 
Dan Nelson
[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: integer not being inserted correctly

2003-12-14 Thread Paul DuBois
At 18:42 -0800 12/14/03, A Pasetti wrote:
When attempting to insert an integer into an integer
column, a different value is being inserted for the
given row. Check out the sql below to see what I mean.
The integer 7819359281 is somehow changed to
2147483647 when it's inserted.
Have you considered what the maximum value for an INT
column is?
You might want to have a look at this section of the manual:

http://www.mysql.com/doc/en/Numeric_types.html

Also, see what the end of this section has to say about
inserting out-of-range values:
http://www.mysql.com/doc/en/INSERT.html

Perhaps someone has experienced this problem and could
suggest a fix. I'm using MySQL 4.0.
Your advice will be greatly appereciated.

Thanks,

Andrew Pasetti

*SQL QUERY RESULTS BELOW*

mysql create table TmpPhoneNumbers
- (
- token char(12) not null,
- number int(12) primary key
- );
Query OK, 0 rows affected (0.05 sec)
mysql insert into TmpPhoneNumbers (token,number)
values ('dabw6pz6zkbc',7819359281);
Query OK, 1 row affected (0.05 sec)
mysql select * from TmpPhoneNumbers;
+--++
| token| number |
+--++
| dabw6pz6zkbc | 2147483647 |
+--++
1 row in set (1.06 sec)


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: integer not being inserted correctly

2003-12-14 Thread Sweet, Charles E
A Pasetti mailto:[EMAIL PROTECTED] wrote:
 When attempting to insert an integer into an integer
 column, a different value is being inserted for the
 given row. Check out the sql below to see what I mean.
 The integer 7819359281 is somehow changed to
 2147483647 when it's inserted.
 
 Perhaps someone has experienced this problem and could
 suggest a fix. I'm using MySQL 4.0.
 
 Your advice will be greatly appereciated.
 
 Thanks,
 
 Andrew Pasetti
 
 *SQL QUERY RESULTS BELOW*
 
 mysql create table TmpPhoneNumbers
 - (
 - token char(12) not null,
 - number int(12) primary key
 - );
 Query OK, 0 rows affected (0.05 sec)
 
 mysql insert into TmpPhoneNumbers (token,number)
 values ('dabw6pz6zkbc',7819359281);
 Query OK, 1 row affected (0.05 sec)
 
 mysql select * from TmpPhoneNumbers;
 +--++
 token| number | +--++
 dabw6pz6zkbc | 2147483647 |
 +--++
 1 row in set (1.06 sec)
 
 __
 Do you Yahoo!?
 Free Pop-Up Blocker - Get it now
 http://companion.yahoo.com/

In the reference 6.2 Column Types, we have the definition of an int -
The signed range is -2147483648 to 2147483647 That would be 
(2 * 1024 * 1024 *1024) - 1

Phone numbers might be better stored as Text unless you're going to do 
arithmetic on them?



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Ugrade from 4.01.3-max to 4.0.16, now slower

2003-12-14 Thread trevor%tribenetwork.com
Hello,

 

I recently upgraded from 4.0.13-max to 4.0.16 and now the same
queries/sec cause a higher load on the database server.  I upgraded to
4.01.6 since the optimizer was not using some of my fulltext indicies.  All
our tables are MyIsam so I figure there is no reason to use the MAX version.
In addition my Redhat 9.0 machine now lists all the mysld threads under top,
whereas before top listied a single myslqd process.  Any information is
appreciated.

 

Thanks,

 

Trevor



Re: blocked database by the server

2003-12-14 Thread Oscar Orellana
Thanks, Paul.

I have read what you say in the manual, but I don't know the way to fix the
problem. Where the instruction FLUSH-HOSTS must be written? In the server?
In MySQLAdmin? How can I write such instruction if after this error I can't
connect to the database at the server anymore?


- Original Message - 
From: Paul DuBois [EMAIL PROTECTED]
To: Oscar Orellana [EMAIL PROTECTED]; MySQL List
[EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 9:07 PM
Subject: Re: blocked database by the server


 At 19:41 -0500 12/14/03, Oscar Orellana wrote:
 Hi, everyone!
 
 I'm a new user in MySQL. I've got a problem: The server told me that
 the database is blocked because of many bad connections. It needs to
 be unblocked. May I do that from my computer or it has to be done
 from the server?

 I am guessing, but it sounds as though you may need to issue a FLUSH HOSTS
 statement.  Check this section in the manual:

 http://www.mysql.com/doc/en/Blocked_host.html


 
 If there are users who speak Spanish, please send me a mail. I don't
 speak English well.
 
 Thanks
 Oscar Orellana


 -- 
 Paul DuBois, Senior Technical Writer
 Madison, Wisconsin, USA
 MySQL AB, www.mysql.com

 Are you MySQL certified?  http://www.mysql.com/certification/



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: integer not being inserted correctly

2003-12-14 Thread David Griffiths
If an INT has a fixed range, then what is the point of giving it scale? As
in, int(12).

In Oracle, a NUMBER(12) indicates how many digits you could have (in this
case, 999 would be the max value).

Would an int(2) allow -99 to 99, or -2147483648 to 2147483647?

Maybe MySQL should throw an error if someone tries to create an int(xyz)
column that exceeds the size of an int?

David.



- Original Message -
From: Dan Nelson [EMAIL PROTECTED]
To: A Pasetti [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 6:48 PM
Subject: Re: integer not being inserted correctly


 In the last episode (Dec 14), A Pasetti said:
  When attempting to insert an integer into an integer column, a
  different value is being inserted for the given row. Check out the
  sql below to see what I mean. The integer 7819359281 is somehow
  changed to 2147483647 when it's inserted.
 
  Perhaps someone has experienced this problem and could suggest a fix.
  I'm using MySQL 4.0.

 Use a larger numeric type.

 http://www.mysql.com/doc/en/Numeric_types.html

 Type  Bytes From To

 TINYINT   1 -128 127
 SMALLINT  2 -32768   32767
 MEDIUMINT 3 -8388608 8388607
 INT   4 -2147483648  2147483647
 BIGINT8 -9223372036854775808 9223372036854775807

 --
 Dan Nelson
 [EMAIL PROTECTED]

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: integer not being inserted correctly

2003-12-14 Thread Daniel Kasak
David Griffiths wrote:

If an INT has a fixed range, then what is the point of giving it scale? As
in, int(12).
In Oracle, a NUMBER(12) indicates how many digits you could have (in this
case, 999 would be the max value).
Would an int(2) allow -99 to 99, or -2147483648 to 2147483647?

Maybe MySQL should throw an error if someone tries to create an int(xyz)
column that exceeds the size of an int?
David.
 

We use the 'scale' ( or whatever it is ... the thing in brackets ) to 
indicate to MySQL what size fields are in a fixed-width import.
See http://www.mysql.com/doc/en/LOAD_DATA.html ... look a bit more than 
half-way down for 'fixed-row'.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Getting Records where date is LESS THAN today, AND...

2003-12-14 Thread Richard
Ok, I got it... I THINK :o)

$sth = $dbh-prepare (qq{ SELECT * FROM newsletters WHERE sent = 1 AND
archive = 1 AND ((sendoutmon = $_current_month AND sendoutday =
$_current_day AND sendoutyear = $_current_year) OR (sendoutyear =
$_current_year)) });


Just checking a second time for anything where the year is less then the
current will cover previous year, regardless of the month, then everything
within this year is covered by the first check.

So far it's working. I'm still open to better ways though ;o)

Thanks,
Richard


- Original Message - 
From: Richard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 7:54 PM
Subject: Getting Records where date is LESS THAN today, AND...


I am Creating a newsletter site for my employer, which will allow him to
just add the newsletter and choose which day to mail it. a cron job runs
everynight and mails out a notice that the newsletter is ready, along with
the link.

I am having a problem getting the date to match up...

I have these 'columns'...

sendoutmon is the MONTH that it will or did get sent out. For example:  12
sendoutday is the DAY of the month it will or did get sent out. For example:
14
sendoutyear is the YEAR that it will or did get sent out. For example 2003
sent Which is an enum, of either 0 or 1. 0 being NOT sent yet. 1 being
already sent
archive Which is telling us if we want it added to the archive or not. so
it's an enum like sent

So I'm trying to Call the records into my Perl Application, which does it
like this...

my $dbh = Sess::Eco::connect();
my $sth = $dbh-prepare (qq{ SELECT * FROM newsletters WHERE archive  = 1
AND sent = ? AND sendoutmon = $_current_month AND sendoutday =
$_current_day AND sendoutyear = $_current_year });
$sth-execute(1);
my $_actual_rows = $dbh-selectrow_array(qq{SELECT COUNT(*) FROM newsletters
WHERE archive  = 1 AND sent = 1 AND sendoutmon = $_current_month AND
sendoutday = $_current_day AND sendoutyear = $_current_year});
while ($row = $sth-fetchrow_hashref()) {
#Print my table records...
}
$sth-finish();

That is not working like it should... I have put 3 testing newsletters into
the database.
1 with these values: (among other irrelevant ones)

sendoutmonsendoutday sendoutyear  archive  sent
11   15  2003 1   1
12   13  2003 1   1
12   15  2003 1   0

So with THOSE 3, test newsletters, 2 of them SHOULD be displayed. But ONLY
the middle one is printed into my table.

I think I'm doing it the totally wrong way.
For instance, if one of the newsletters was last year, then it would not be
correct, such as this...
If today was January 1, 2004 then none of those would be displayed, because
the month and the Day would not be
less then the sendoutmon or sendoutday.

So, how can I do this?
In the Admin menu I created for him, when he chooses when to send it, then
it uses a calander where he can
choose a date, which is formated like this: mm/dd/ So I have it check to
make sure it's in the future, but
not to distant future.

Is there a BETTER way to do this? I know there is, but can someone give me
an example?
I want to do it right now, instead of finish this project, then have to go
re-code half the scripts/databases.

Thank you in advance for any tips/advice you have.
Richard
FRHweb


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: blocked database by the server

2003-12-14 Thread Paul DuBois
At 21:56 -0500 12/14/03, Oscar Orellana wrote:
Thanks, Paul.

I have read what you say in the manual, but I don't know the way to fix the
problem. Where the instruction FLUSH-HOSTS must be written? In the server?
In MySQLAdmin? How can I write such instruction if after this error I can't
connect to the database at the server anymore?
Connect as root from localhost.  The block, if it's what I think it
is, for the host that's having trouble connecting.


- Original Message -
From: Paul DuBois [EMAIL PROTECTED]
To: Oscar Orellana [EMAIL PROTECTED]; MySQL List
[EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 9:07 PM
Subject: Re: blocked database by the server

 At 19:41 -0500 12/14/03, Oscar Orellana wrote:
 Hi, everyone!
 
 I'm a new user in MySQL. I've got a problem: The server told me that
 the database is blocked because of many bad connections. It needs to
 be unblocked. May I do that from my computer or it has to be done
 from the server?
 I am guessing, but it sounds as though you may need to issue a FLUSH HOSTS
 statement.  Check this section in the manual:
 http://www.mysql.com/doc/en/Blocked_host.html

 
 If there are users who speak Spanish, please send me a mail. I don't
 speak English well.
 
 Thanks
 Oscar Orellana
 --
 Paul DuBois, Senior Technical Writer
 Madison, Wisconsin, USA
 MySQL AB, www.mysql.com
 Are you MySQL certified?  http://www.mysql.com/certification/



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: integer not being inserted correctly

2003-12-14 Thread Paul DuBois
At 19:12 -0800 12/14/03, David Griffiths wrote:
If an INT has a fixed range, then what is the point of giving it scale? As
in, int(12).
That's not a scale.  For integer types, it's a display width.  It has
nothing to do with the allowable range of the underlying data type.
http://www.mysql.com/doc/en/Numeric_types.html

In Oracle, a NUMBER(12) indicates how many digits you could have (in this
case, 999 would be the max value).
Would an int(2) allow -99 to 99, or -2147483648 to 2147483647?

Maybe MySQL should throw an error if someone tries to create an int(xyz)
column that exceeds the size of an int?
David.



- Original Message -
From: Dan Nelson [EMAIL PROTECTED]
To: A Pasetti [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 6:48 PM
Subject: Re: integer not being inserted correctly

 In the last episode (Dec 14), A Pasetti said:
  When attempting to insert an integer into an integer column, a
  different value is being inserted for the given row. Check out the
  sql below to see what I mean. The integer 7819359281 is somehow
  changed to 2147483647 when it's inserted.
 
  Perhaps someone has experienced this problem and could suggest a fix.
  I'm using MySQL 4.0.
 Use a larger numeric type.

 http://www.mysql.com/doc/en/Numeric_types.html

 Type  Bytes From To

 TINYINT   1 -128 127
 SMALLINT  2 -32768   32767
 MEDIUMINT 3 -8388608 8388607
 INT   4 -2147483648  2147483647
 BIGINT8 -9223372036854775808 9223372036854775807
 --
 Dan Nelson
  [EMAIL PROTECTED]


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: foreign keys.

2003-12-14 Thread Mofeed Shahin
On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote:
 At 11:09 +1030 12/15/03, Mofeed Shahin wrote:
 I'm trying to create a bunch of tables in MySQL. I'm having problems
  creating the following table :
 
 CREATE TABLE foo(
  ID INT PRIMARY KEY,
  note VARCHAR(50),
  FOO_ID INT,
  FOREIGN KEY (FOO_ID) REFERENCES foo(ID)
 ) TYPE=INNODB;
 
 The error I get is the following :
 ERROR 1005: Can't create table './moftest/foo.frm' (errno: 150)
 
 I found out that errno 150 means that it didn't like the Foreign key
 constraint.
 
 Does MySQL not support this type of Foreign Key constraint ?

 If does.  However, a foreign key must be indexed, and you have declared
 no index on FOO_ID.  Try this:

 CREATE TABLE foo(
  ID INT PRIMARY KEY,
  note VARCHAR(50),
  FOO_ID INT,
  INDEX (FOO_ID),
  FOREIGN KEY (FOO_ID) REFERENCES foo(ID)
 ) TYPE=INNODB;

Thanks, but I just did, and I got the same error message.

Mof.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: new install - command prompt doesn't work

2003-12-14 Thread Betta Jazzy Brown
someone's the man...
and i think we all KNOW who it is...
:oD
 
thanks a lot Bob...it works...finally...
 
thanks to everyone...again

Bob Loeffler [EMAIL PROTECTED] wrote:
If you are using Windows 2000, do the following to set the path. If you have
Windows NT, the steps are similar, but slightly different after the System
icon part (I can't remember exactly).

START - Settings - Control Panel - System icon - Advanced tab -
Environment Variables button

Then, in the System Variables section, double-click on the Path entry. A
little dialog should appear so you can edit the Path entry. In the Variable
Value field, add the following (the semicolon separate each individual path,
so you need it):

;c:\mysql\bin

Now click on the OK button in each of those dialogs to save the info. Now
you shouldn't have a problem the next time you open a command prompt window
and type in 'mysql' to run the mysql client application.

Bob Loeffler :)


-Original Message-
From: Betta Jazzy Brown [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 13, 2003 12:10 PM
To: [EMAIL PROTECTED]
Subject: Re: new install - command prompt doesn't work


ok...i set the path properly...

in the command line, i did this:

C:\C:\mysql\bin;C:\WINNT;C:\WINNT\COMMAND

then, i am able to just type in mysql and it will begin...

BUT...after i close the command prompt, once i reopen it, and type in
mysql, it goes and says that mysql is not a command or recognizable...

is there something that i'm still missing?


Paul DuBois 
wrote:
At 6:48 -0800 12/13/03, Betta Jazzy Brown wrote:
i have done that

C:\mysql

but it will say

'mysql' is not recognized as an internal or external command,
operable program or batch file

there must be something else i'm missing...

This is not a MySQL issue. It's a PATH issue.

Either set your PATH to include the directory where the MySQL
programs are located (likely C:\mysql\bin, though that depends on
your installation), or invoke mysql from within that directory,
or invoke mysql using its full pathname.

Setting your PATH is the best option, because then you can invoke
MySQL programs from within any directory and the command interpreter
will find them.




Paul DuBois
wrote:

At 18:21 -0800 12/12/03, Betta Jazzy Brown wrote:
I have installed MySql on my PC and I was trying to run the program
by going to the command prompt typing:

C:\net start mysql

it says

The MySql service has started successfully.

the problem is that the command prompt doesn't read
mysql

but still reads
C:\

What is the problem here and how can I correct it...

There is no problem. The server has started successfully.

But you need to *connect* to the server using a client program.
Try running mysql from the C prompt, for example:

C:\ mysql


i have installed MySql Database Server  Standard Clients (4.0)

and MySql Control Center

and I'm using Win2K OS...

--

As well...what specifically can I use MySql for? I have a website
that I'm trying to learn a lot of things through to make my resume
more beefy and to make myself more marketable...What do you all
suggest?

Thanks,
 b-jazzy


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]


user permissions on test ( DBD::mysql)

2003-12-14 Thread Kermit Tensmeyer
 In previous installs, I've never been able to do it 'right'
 but fresh install (4.1.1), new machine. So I'd like to set it up
so perl Makefile.PL on modules will install without having to pass special
parameters to build process.

 First.  mysql_install_db sets up the test db so that the anonymous user
 (that is any machine identifer user who is not identified to mysql) has
 all the privledges that are need to test.

 But at the point of testing, it is required that [EMAIL PROTECTED] have an
 empty password to test against the 'test' DBS. As soon as the database is
 installed, most root accounts have a significant password.

 How can I setup a user 'root' to grant all priveledges on test -and-
 having a null password? while still protecting the other databases?

 [[ Installing modules in Perl generally requires root level privledges
 and so root is -never- an anonymous mysql user. ]]

 is there a way to set things up so that a standard set of parameters can
 be passed to perl Makefile.PL to generate a successfull make test
 situation (consider perl -MCPAN -e shell)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Ugrade from 4.01.3-max to 4.0.16, now slower

2003-12-14 Thread Chris Nolan
Hi!

The optimizer issue is a known bug in 4.0.16 (I think). It should be
resolved soon if my memory of the traffic on the list as of late is
accurate.

Regarding the issue with threads on Redhat 9.0 - did MySQL 4.0.13-Max
come with Redhat 9.0 (or was it supplied by Redhat)? If it was, then
chances are it used the NPTL library which provides proper POSIX
thread semantics, meaning that all threads in a process share the same
PID and thus don't show up individually in top or other process
monitoring/auditing programs.

If you downloaded 4.0.16 from anywhere else, it will have been linked
against the LinuxThreads library, which uses the clone() system call to
create new threads, resulting in each thread having a unique PID and
being visible in top.

Hope this helps!

Regards,

Chris

On Mon, 2003-12-15 at 13:54, trevor%tribenetwork.com wrote:
 Hello,
 
  
 
 I recently upgraded from 4.0.13-max to 4.0.16 and now the same
 queries/sec cause a higher load on the database server.  I upgraded to
 4.01.6 since the optimizer was not using some of my fulltext indicies.  All
 our tables are MyIsam so I figure there is no reason to use the MAX version.
 In addition my Redhat 9.0 machine now lists all the mysld threads under top,
 whereas before top listied a single myslqd process.  Any information is
 appreciated.
 
  
 
 Thanks,
 
  
 
 Trevor
 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Documentation bug?

2003-12-14 Thread Chris Nolan
It seems slightly ambiguous - updates are redirected and stalled. The
fact that the two statements are in different sentences threw me off
slightly.

To everyone else who replied, thanks for your tolerance.

Regards,

Chris

On Mon, 2003-12-15 at 03:55, Jeremy Zawodny wrote:
 On Mon, Dec 15, 2003 at 02:58:53AM +1100, Chris Nolan wrote:
  Hi all, while reading through some of the MySQL docs, I noticed the 
  following paragraph:
  
  |ALTER TABLE| works by making a temporary copy of the original table. 
  The alteration is performed on the copy, then the original table is 
  deleted and the new one is renamed. This is done in such a way that all 
  updates are automatically redirected to the new table without any failed 
  updates. While |ALTER TABLE| is executing, the original table is 
  readable by other clients. Updates and writes to the table are stalled 
  until the new table is ready.
  
  This seems a bit confusing. On one hand, it says that updates don't 
  fail, but on the other hand it says they are stalled until ALTER TABLE 
  is done executing. Am I going blind/loosing my mind (a possibility I am 
  open to) or do others agree with me?
 
 What exactly is the discrepancy you see?  Can you be explicit?
 
 The manual describes the way ALTER TABLE works accurately.
 
 Jeremy
 -- 
 Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
 [EMAIL PROTECTED]  |  http://jeremy.zawodny.com/


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]