Re: MySQL Administrator Cron Errors

2005-10-12 Thread Gleb Paharenko
Hello.



There are  numerous bugs in MySQL Administrator (but mostly closed)

where the key word is 'profile'. If necessary, you can access the source

repository and build the latest available version, including the bugfix,

yourself. More information about accessing the source trees is available at

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





Rich wrote:

 Hi folks.

 

 Downloaded the new Admin for OS X.  I set a weekly cron and for some reason,

 it's emailing my terminal Mail app saying it couldn't load a profile.

 

 It's not the address I told it to send it to, and I don't quite get why it

 can't load a profile.

 

 Having just tried to back up my tables twice directly from the application,

 it crashed twice.

 

 Is this thing buggy?

 

 Cheers 

 

 

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




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



回复: Charset issue

2005-10-12 Thread 维斯 苏
no,you do not need to modify anything,it just because utf8 which phpmyadmin2.6 
default setting conflict with mysql's latin1,so just copy a set of phpmyadmin 
2.5.5,and install the mysql 4.1 as default,and every will be ok,that's all.

王静 [EMAIL PROTECTED] 写道:hi all.
Here is the suituation. i've installed mysql 4.1.12 on WinXP
plantform, it seems not to support Chinese by its default
configuration, say, Chinese can't be displayer propely. as far as i
know, what i need to do is modify the charset(server, connection,
client...)concerned, but i'm not so sure and is there anything else i
should do and howto?
3x.

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




-
 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱
 雅虎助手-搜索、杀毒、防骚扰  

Comparing Numbers in Text Fields

2005-10-12 Thread zzapper
Hi,
Recently had a few problems with comparing numbers stored in text mysql fields 
char(2), which I
solved by chnging the field to int(1)

Now my question is why do you sometimes appear to get away with this?


-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/


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



Re: Comparing Numbers in Text Fields

2005-10-12 Thread Neculai Macarie
zzapper wrote:
 Hi,
 Recently had a few problems with comparing numbers stored in text
 mysql fields char(2), which I solved by chnging the field to int(1)

 Now my question is why do you sometimes appear to get away with
 this?

My guess is that if the numbers are of the same length (number of
characters) then the alpha sorting works ok.

-- 
mack /


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



Re: Comparing Numbers in Text Fields

2005-10-12 Thread zzapper
On Wed, 12 Oct 2005 13:27:52 +0200,  wrote:

zzapper wrote:
 Hi,
 Recently had a few problems with comparing numbers stored in text
 mysql fields char(2), which I solved by chnging the field to int(1)

 Now my question is why do you sometimes appear to get away with
 this?

My guess is that if the numbers are of the same length (number of
characters) then the alpha sorting works ok.

-- 
mack /

Mack,
I guess you are right, as coincidentally, I recently had the same problem with 
MS-Access DB where a
search for largest number in a column worked until  the largest number exceeded 
999, thereafter 999
was seen as greater than 1000..


-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/


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



Re: concat() function

2005-10-12 Thread Luciano Centeno
I'm sorry, my mistake. The type definition is
 *nloc_num,ins_numero and ins_digi are decimal(5,0)

2005/10/11, Luciano Centeno [EMAIL PROTECTED]:
 hello, my friends, the query option 1 return the right value,
 the query option 2 not. Why concat function make the difference?


 *nloc_num,ins_numero and ins_digi are decimal(3,0)



 /
 option 1 .-

 select max(bi_num) as num
 from b_inmuebles
 where concat(nloc_num) = 1 and
   concat(ins_numero)= 1770 and
   concat(ins_digi)= 1


 return it 1


 /
 option 2 .-

 select max(bi_num) as num
 from b_inmuebles
 where nloc_num = 1 and
   ins_numero= 1770 and
   ins_digi= 1

 return it NULL


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



Help with query

2005-10-12 Thread Dušan Pavlica
Hello,

could someone help me please to construct correct query or tell me what I'm 
doing wrong?

I have three tables:
table products
table products_codes where some products could have assigned another additional 
codes 
table products_prices
I want to get all rows from product_prices listed  with product Description and 
Code for particular CodeType

And here is the create script, sample data and the query:

CREATE TABLE  `products` (
  `ID` int(10) unsigned NOT NULL auto_increment,
  `Description` varchar(50) NOT NULL default '',
  `Units` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB;

INSERT INTO products VALUES(NULL, Product 1, lt);
INSERT INTO products VALUES(NULL, Product 2, lt);
INSERT INTO products VALUES(NULL, Product 3, lt);

CREATE TABLE  `products_codes` (
  `Product_ID` int(10) unsigned NOT NULL default '0',
  `Code` varchar(50) NOT NULL default '',
  `CodeType` tinyint NOT NULL default '',
  PRIMARY KEY  (`Product_ID`,`CodeType`)
) ENGINE=InnoDB;

INSERT INTO products_codes VALUES(1, ABC, 1);
INSERT INTO products_codes VALUES(2, XYZ, 1);

CREATE TABLE  `products_prices` (
  `Product_ID` int(10) unsigned NOT NULL default '0',
  `StartDate` datetime NOT NULL default '-00-00 00:00:00',
  `Price` double NOT NULL default '0',
  PRIMARY KEY  (`Product_ID`,`StartDate`)
) ENGINE=InnoDB;

INSERT INTO products_prices VALUES(1, '2005090100', 20);
INSERT INTO products_prices VALUES(1, '2005100100', 25);
INSERT INTO products_prices VALUES(1, '2005110100', 30);
INSERT INTO products_prices VALUES(2, '2005100100', 15);
INSERT INTO products_prices VALUES(3, '2005100100', 10);

SELECT p.Description, p.ID, pp.Product_ID, pc.Code, pp.StartDate FROM 
products_prices pp
INNER JOIN (products p
LEFT JOIN products_codes pc ON p.ID = pc.Product_ID AND pc.CodeType = 1)
ON p.ID = pp.Product_ID
where StartDate  Now()
ORDER BY p.ID, pp.StartDate desc

Here is the result of the query:
Description,ID,Product_ID,Code,StartDate

Product 1,1,3,NULL,2005-10-01 00:00:00
Product 1,1,1,ABC,2005-10-01 00:00:00
Product 1,1,2,NULL,2005-10-01 00:00:00
Product 1,1,1,ABC,2005-09-01 00:00:00
Product 2,2,2,XYZ,2005-10-01 00:00:00
Product 2,2,3,NULL,2005-10-01 00:00:00
Product 2,2,1,NULL,2005-10-01 00:00:00
Product 2,2,1,NULL,2005-09-01 00:00:00
Product 3,3,2,NULL,2005-10-01 00:00:00
Product 3,3,3,NULL,2005-10-01 00:00:00
Product 3,3,1,NULL,2005-10-01 00:00:00
Product 3,3,1,NULL,2005-09-01 00:00:00

I don't know why this query returns also rows where p.ID != pp.ProductID


And another thing. If I remove from selected columns pp.Product_ID query 
returns error:
Column 'Product_ID' in field list is ambiguous (ErrorNr. 1052). Why??

MySQL 4.1.14, WinXP

Thanks a lot in advance for any help



Kind regards,
Dusan Pavlica

Restore using mysqldump (MySQL 4.1.12)

2005-10-12 Thread John Doneker
Hi, I am trying to restore from an .sql file created by mysqldump.
To restore I am using mysqldump as well.
 
I deleted all of the rows in a table.
When I restore it is still empty.
 
I noticed on my screen that the dump does inserts but the restore does not.
I am using the -c option.
 
Can someone please help? 
 
Thanks you all.
Wayne.
 
 
J. Wayne Doneker
BAE Systems  
York Pa.
717 225 8109 
Email: [EMAIL PROTECTED]




Re: Restore using mysqldump (MySQL 4.1.12)

2005-10-12 Thread Arno Coetzee

John Doneker wrote:


Hi, I am trying to restore from an .sql file created by mysqldump.
To restore I am using mysqldump as well.

I deleted all of the rows in a table.
When I restore it is still empty.

I noticed on my screen that the dump does inserts but the restore does not.
I am using the -c option.

Can someone please help? 


Thanks you all.
Wayne.


J. Wayne Doneker
BAE Systems  
York Pa.
717 225 8109 
Email: [EMAIL PROTECTED]




 


try this wayne

mysql 'databasename' 'filename'

--
Arno Coetzee
Developer
Flash Media Group
Office : +27 12 342 3490
Mobile : +27 82 693 6180
Fax : + 27 12 430 4269
www.flashmedia.co.za

FMG Total messaging solution.  For all your GSM (SMS and USSD) messaging needs.  
Quick and easy do-it-yourself interfaces. http://www.flashmedia.co.za/tms.php 


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



Database user Permissions

2005-10-12 Thread Jeff
Just rebuilt one of my servers and when setting up MySQL again an old
problem I'd had and worked around came up again.

Why is it that if I grant a user@'%' permissions, that user can access
the database from any other machine on the network, but that same user
logon accessing the db from the local system, fails until I actually
create another grant record for [EMAIL PROTECTED]

It's not a huge problem but I'd like to understand it better.

Thanks,

Jeff



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



Re: Help with query

2005-10-12 Thread Michael Stassen

Dušan Pavlica wrote:

Hello,

could someone help me please to construct correct query or tell me what I'm 
doing wrong?

I have three tables:
table products
table products_codes where some products could have assigned another additional codes 
table products_prices

I want to get all rows from product_prices listed  with product Description and 
Code for particular CodeType

And here is the create script, sample data and the query:

CREATE TABLE  `products` (
  `ID` int(10) unsigned NOT NULL auto_increment,
  `Description` varchar(50) NOT NULL default '',
  `Units` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB;

INSERT INTO products VALUES(NULL, Product 1, lt);
INSERT INTO products VALUES(NULL, Product 2, lt);
INSERT INTO products VALUES(NULL, Product 3, lt);

CREATE TABLE  `products_codes` (
  `Product_ID` int(10) unsigned NOT NULL default '0',
  `Code` varchar(50) NOT NULL default '',
  `CodeType` tinyint NOT NULL default '',
  PRIMARY KEY  (`Product_ID`,`CodeType`)
) ENGINE=InnoDB;

INSERT INTO products_codes VALUES(1, ABC, 1);
INSERT INTO products_codes VALUES(2, XYZ, 1);

CREATE TABLE  `products_prices` (
  `Product_ID` int(10) unsigned NOT NULL default '0',
  `StartDate` datetime NOT NULL default '-00-00 00:00:00',
  `Price` double NOT NULL default '0',
  PRIMARY KEY  (`Product_ID`,`StartDate`)
) ENGINE=InnoDB;

INSERT INTO products_prices VALUES(1, '2005090100', 20);
INSERT INTO products_prices VALUES(1, '2005100100', 25);
INSERT INTO products_prices VALUES(1, '2005110100', 30);
INSERT INTO products_prices VALUES(2, '2005100100', 15);
INSERT INTO products_prices VALUES(3, '2005100100', 10);

SELECT p.Description, p.ID, pp.Product_ID, pc.Code, pp.StartDate FROM 
products_prices pp
INNER JOIN (products p
LEFT JOIN products_codes pc ON p.ID = pc.Product_ID AND pc.CodeType = 1)
ON p.ID = pp.Product_ID
where StartDate  Now()
ORDER BY p.ID, pp.StartDate desc

Here is the result of the query:
Description,ID,Product_ID,Code,StartDate

Product 1,1,3,NULL,2005-10-01 00:00:00
Product 1,1,1,ABC,2005-10-01 00:00:00
Product 1,1,2,NULL,2005-10-01 00:00:00
Product 1,1,1,ABC,2005-09-01 00:00:00
Product 2,2,2,XYZ,2005-10-01 00:00:00
Product 2,2,3,NULL,2005-10-01 00:00:00
Product 2,2,1,NULL,2005-10-01 00:00:00
Product 2,2,1,NULL,2005-09-01 00:00:00
Product 3,3,2,NULL,2005-10-01 00:00:00
Product 3,3,3,NULL,2005-10-01 00:00:00
Product 3,3,1,NULL,2005-10-01 00:00:00
Product 3,3,1,NULL,2005-09-01 00:00:00

I don't know why this query returns also rows where p.ID != pp.ProductID


And another thing. If I remove from selected columns pp.Product_ID query 
returns error:
Column 'Product_ID' in field list is ambiguous (ErrorNr. 1052). Why??

MySQL 4.1.14, WinXP

Thanks a lot in advance for any help

Kind regards,
Dusan Pavlica


I haven't really tried to figure out what mysql is doing with your query, 
but perhaps these lines from the manual 
http://dev.mysql.com/doc/mysql/en/join.html are relevant:


  In versions of MySQL prior to 5.0.1, parentheses in table_references were
  just omitted and all join operations were grouped to the left. In general,
  parentheses can be ignored in join expressions containing only inner join
  operations. As of 5.0.1, nested joins are allowed (see Section 7.2.10,
  “How MySQL Optimizes Nested Joins”).

In any case, does this do what you want?

  SELECT p.Description, p.ID, pp.Product_ID, pc.Code, pp.StartDate
  FROM products_prices pp
  JOIN products p ON p.ID = pp.Product_ID
  LEFT JOIN products_codes pc ON p.ID = pc.Product_ID AND pc.CodeType = 1
  WHERE StartDate  Now()
  ORDER BY p.ID, pp.StartDate DESC;

Michael


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



Re: Restore using mysqldump (MySQL 4.1.12)

2005-10-12 Thread SGreen
John Doneker [EMAIL PROTECTED] wrote on 10/11/2005 04:43:40 
PM:

 Hi, I am trying to restore from an .sql file created by mysqldump.
 To restore I am using mysqldump as well.
 
 I deleted all of the rows in a table.
 When I restore it is still empty.
 
 I noticed on my screen that the dump does inserts but the restore does 
not.
 I am using the -c option.
 
 Can someone please help? 
 
 Thanks you all.
 Wayne.
 
 
 J. Wayne Doneker
 BAE Systems 
 York Pa.
 717 225 8109 
 Email: [EMAIL PROTECTED]
 
 

mysqldump only creates a sql script of a database. It does not replay that 
script into a database. 

http://dev.mysql.com/doc/mysql/en/mysqldump.html

The best tool for that would be the command line interface (CLI) otherwise 
known as mysql.exe. You can either redirect your script to play into the 
executable with a  or once you start it up you can replay your script 
with the source command (the shortcut for source is a period)

http://dev.mysql.com/doc/mysql/en/mysql.html

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Re: Database user Permissions

2005-10-12 Thread SGreen
Jeff [EMAIL PROTECTED] wrote on 10/12/2005 08:43:16 AM:

 Just rebuilt one of my servers and when setting up MySQL again an old
 problem I'd had and worked around came up again.
 
 Why is it that if I grant a user@'%' permissions, that user can access
 the database from any other machine on the network, but that same user
 logon accessing the db from the local system, fails until I actually
 create another grant record for [EMAIL PROTECTED]
 
 It's not a huge problem but I'd like to understand it better.
 
 Thanks,
 
 Jeff
 

http://dev.mysql.com/doc/mysql/en/adding-users.html

The security system wisely treats local users and remote users 
differently. For a truly secure server, someone must be physically at the 
machine in order to make a localhost login attempt. This presumes that 
some level of physical security also protects that machine. If an 
administrator had only one account, it wouldn't make a difference from 
where they logged in. That would be a hole in the security plan as you now 
have exposed admin rights beyond the server's physical security perimeter.

Think about it in terms of James Bond or Mission Impossible. They 
wouldn't need to break into the vault containing the database computer if 
an administrative account could do what they wanted from outside, would 
they?  With the two-tier system, an administrator could have limited 
privileges when not physically at the console and full privileges while at 
the console. 

Of course, logging in to the server through SSH, telnet, or some other 
remote terminal software defeats this kind of security check as the user 
now appears to be at the local terminal. Oh, well. It is not perfect but 
it is better than nothing at all!

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

automatic backups not working MySql Admin

2005-10-12 Thread John Doneker
I've downloaded the MySQL Admin 1.1 freeware tool to backup a mysql database. 

It works fine except that the timer doesn't work. When I set a time in the 
'time' field, lets say 8:00, the backup never kicks off. 

Is this because this free software doesn't supply this functionality? Or could 
it be a bug? Is there another answer?

Thanks to all. 

J. Wayne Doneker
BAE Systems  
York Pa.
717 225 8109 
Email: [EMAIL PROTECTED]



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



re: possible bug in mysql 5.0.13

2005-10-12 Thread James Black
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Due to the complexity of my query I don't know how to get this down to a
simple test case to demonstrate the error.

This works under mysql 4.1.8 btw, so it is failing due to a change
introduced recently.  It also worked under mysql 5.0.9, but I haven't
tested any of the beta versions between 9 and 13.

Any suggestions as to what I may look at to make this simpler?

I will be working on it in the meantime, to see what I find.

mysql INSERT INTO curuse(rid, start, badge, ip, card_type, fullname,
dept, college, campus)
SELECT 12612,1129124442, n.badge, 0,
(SELECT role FROM nams.names WHERE badge=n.badge),
(SELECT IF(p.fullname IS NULL,
(SELECT CONCAT(sna.fname, ' ', sna.mname, ' ', sna.lname, ' ', sna.gen)
FROM nams.names AS sna WHERE sna.badge=sne.badge), p.fullname) AS
fullname FROM nams.netids AS sne LEFT OUTER JOIN nams.prefs AS p
ON(sne.badge=p.badge) WHERE sne.netid='jblack') AS fullnameTable,
(SELECT d.dabbr FROM nams.affiliations f, nams.roles r, nams.departments
d WHERE f.role=r.code AND f.deptid=d.deptid AND f.badge=n.badge AND
d.dabbr !='' ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1), (SELECT
f.college FROM nams.affiliations f, nams.roles r, nams.colleges d WHERE
f.role=r.code AND f.college=d.code AND f.badge=n.badge AND d.code !=''
ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1), (SELECT f.campus FROM
nams.affiliations f, nams.roles r, nams.departments d WHERE
f.role=r.code AND f.deptid=d.deptid AND f.badge=n.badge AND d.dabbr !=''
ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1) FROM items i,
nams.netids n INNER JOIN nams.names AS na ON n.badge=na.badge INNER JOIN
nams.affiliations AS a ON a.badge=na.badge INNER JOIN nams.roles AS r ON
a.role=r.code

LEFT OUTER JOIN curuse AS c ON (c.rid=i.rid)

WHERE r.lmsvalid='Y' AND a.enddate IS NULL AND i.rid=1999 AND
n.netid='jblack' AND (i.status='A' OR c.badge IS NULL) LIMIT 1;

ERROR 1054 (42S22): Unknown column 'i.rid' in 'on clause'

+--+--+--+-+-++
| Field | Type | Null | Key | Default | Extra |
+--+--+--+-+-++
| rid | int(11)  | NO | PRI | NULL | auto_increment |
| lid | int(11)  | NO | MUL | 0 | |
| itemtype | char(4)  | NO | MUL | | |
| label | char(12) | NO | UNI | | |
| status | char(1)  | NO | | | |
| layoutx | int(11)  | YES | | NULL | |
| layouty | int(11)  | YES | | NULL | |
| theta | int(11)  | YES | | NULL | |
+--+--+--+-+-++
8 rows in set (0.02 sec) mysql describe curuse;

+---+-+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+-+--+-+-+---+
| rid | int(11)  | NO | PRI | 0 | |
| start | int(11)  | NO | | 0 | |
| badge | int(11)  | NO | MUL | 0 | |
| card_type | char(2)  | NO | | | |
| dept | char(3)  | NO | | | |
| college | char(2)  | NO | | | |
| campus | char(1)  | NO | || |
| fullname | varchar(24) | NO | | | |
| ip | varchar(40) | NO | PRI | ||
| alive | int(11)  | NO | | 0 | |
+---+-+--+-+-+---+
10 rows in set (0.02 sec)
- --
Love is mutual self-giving that ends in self-recovery. Fulton Sheen
James Black[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTRZfikQgpVn8xrARAo5LAJ0fkAmKtxtMHHGWMY2kcnSOuXVCqQCbB4sH
A4h+LzTgcZns66WLG2xOp9c=
=YIgR
-END PGP SIGNATURE-

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



Re: Help with query

2005-10-12 Thread Dušan Pavlica

Thanks, Michal, for your help.
Your query works as I need.
I tried to use same syntax as in MS Access, but results are for some reason 
different for this query. I'm working on application which should be able to 
connect to MySQL or to MSAccess (users' choice) and I didn't want to write 
querries for each DB system separately. Now I see that I will have to.


Dusan



- Original Message - 
From: Michael Stassen [EMAIL PROTECTED]

To: Dušan Pavlica [EMAIL PROTECTED]
Cc: list mysql mysql@lists.mysql.com
Sent: Wednesday, October 12, 2005 2:54 PM
Subject: Re: Help with query



Dušan Pavlica wrote:

Hello,

could someone help me please to construct correct query or tell me what 
I'm doing wrong?


I have three tables:
table products
table products_codes where some products could have assigned another 
additional codes table products_prices
I want to get all rows from product_prices listed  with product 
Description and Code for particular CodeType


And here is the create script, sample data and the query:

CREATE TABLE  `products` (
  `ID` int(10) unsigned NOT NULL auto_increment,
  `Description` varchar(50) NOT NULL default '',
  `Units` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB;

INSERT INTO products VALUES(NULL, Product 1, lt);
INSERT INTO products VALUES(NULL, Product 2, lt);
INSERT INTO products VALUES(NULL, Product 3, lt);

CREATE TABLE  `products_codes` (
  `Product_ID` int(10) unsigned NOT NULL default '0',
  `Code` varchar(50) NOT NULL default '',
  `CodeType` tinyint NOT NULL default '',
  PRIMARY KEY  (`Product_ID`,`CodeType`)
) ENGINE=InnoDB;

INSERT INTO products_codes VALUES(1, ABC, 1);
INSERT INTO products_codes VALUES(2, XYZ, 1);

CREATE TABLE  `products_prices` (
  `Product_ID` int(10) unsigned NOT NULL default '0',
  `StartDate` datetime NOT NULL default '-00-00 00:00:00',
  `Price` double NOT NULL default '0',
  PRIMARY KEY  (`Product_ID`,`StartDate`)
) ENGINE=InnoDB;

INSERT INTO products_prices VALUES(1, '2005090100', 20);
INSERT INTO products_prices VALUES(1, '2005100100', 25);
INSERT INTO products_prices VALUES(1, '2005110100', 30);
INSERT INTO products_prices VALUES(2, '2005100100', 15);
INSERT INTO products_prices VALUES(3, '2005100100', 10);

SELECT p.Description, p.ID, pp.Product_ID, pc.Code, pp.StartDate FROM 
products_prices pp

INNER JOIN (products p
LEFT JOIN products_codes pc ON p.ID = pc.Product_ID AND pc.CodeType = 
1)

ON p.ID = pp.Product_ID
where StartDate  Now()
ORDER BY p.ID, pp.StartDate desc

Here is the result of the query:
Description,ID,Product_ID,Code,StartDate

Product 1,1,3,NULL,2005-10-01 00:00:00
Product 1,1,1,ABC,2005-10-01 00:00:00
Product 1,1,2,NULL,2005-10-01 00:00:00
Product 1,1,1,ABC,2005-09-01 00:00:00
Product 2,2,2,XYZ,2005-10-01 00:00:00
Product 2,2,3,NULL,2005-10-01 00:00:00
Product 2,2,1,NULL,2005-10-01 00:00:00
Product 2,2,1,NULL,2005-09-01 00:00:00
Product 3,3,2,NULL,2005-10-01 00:00:00
Product 3,3,3,NULL,2005-10-01 00:00:00
Product 3,3,1,NULL,2005-10-01 00:00:00
Product 3,3,1,NULL,2005-09-01 00:00:00

I don't know why this query returns also rows where p.ID != pp.ProductID


And another thing. If I remove from selected columns pp.Product_ID query 
returns error:

Column 'Product_ID' in field list is ambiguous (ErrorNr. 1052). Why??

MySQL 4.1.14, WinXP

Thanks a lot in advance for any help

Kind regards,
Dusan Pavlica


I haven't really tried to figure out what mysql is doing with your query, 
but perhaps these lines from the manual 
http://dev.mysql.com/doc/mysql/en/join.html are relevant:


  In versions of MySQL prior to 5.0.1, parentheses in table_references 
were
  just omitted and all join operations were grouped to the left. In 
general,
  parentheses can be ignored in join expressions containing only inner 
join

  operations. As of 5.0.1, nested joins are allowed (see Section 7.2.10,
  “How MySQL Optimizes Nested Joins”).

In any case, does this do what you want?

  SELECT p.Description, p.ID, pp.Product_ID, pc.Code, pp.StartDate
  FROM products_prices pp
  JOIN products p ON p.ID = pp.Product_ID
  LEFT JOIN products_codes pc ON p.ID = pc.Product_ID AND pc.CodeType = 1
  WHERE StartDate  Now()
  ORDER BY p.ID, pp.StartDate DESC;

Michael


--
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: automatic backups not working MySql Admin

2005-10-12 Thread Rich
If you open your terminal, you'll see some error messages waiting for you.
Apparently it's buggy.  I turned off my admin backups.

Cheers


John Doneker:

 Is this because this free software doesn't supply this functionality? Or could
 it be a bug? Is there another answer?



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



RE: Database user Permissions

2005-10-12 Thread Jeff
Shawn,

Thanks again for responding :o)

All understood, it seems to me though that this is achieved when you
create the user by specifying where the specific user can login from.

So granting permissions to user@'%' means from anywhere while
[EMAIL PROTECTED] means only when they access from that server.  I guess
that could be easily spoofed though.

In any event, thanks for a thorough answer, at least I know the behavior
is truly by design.

Jeff
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 12, 2005 09:53
 To: Jeff
 Cc: mysql@lists.mysql.com
 Subject: Re: Database user Permissions
 
 
 Jeff [EMAIL PROTECTED] wrote on 10/12/2005 08:43:16 AM:
 
  Just rebuilt one of my servers and when setting up MySQL 
 again an old
  problem I'd had and worked around came up again.
  
  Why is it that if I grant a user@'%' permissions, that user 
 can access
  the database from any other machine on the network, but 
 that same user
  logon accessing the db from the local system, fails until I actually
  create another grant record for [EMAIL PROTECTED]
  
  It's not a huge problem but I'd like to understand it better.
  
  Thanks,
  
  Jeff
  
 
http://dev.mysql.com/doc/mysql/en/adding-users.html

The security system wisely treats local users and remote users 
differently. For a truly secure server, someone must be physically at
the 
machine in order to make a localhost login attempt. This presumes that 
some level of physical security also protects that machine. If an 
administrator had only one account, it wouldn't make a difference from 
where they logged in. That would be a hole in the security plan as you
now 
have exposed admin rights beyond the server's physical security
perimeter.

Think about it in terms of James Bond or Mission Impossible. They 
wouldn't need to break into the vault containing the database computer
if 
an administrative account could do what they wanted from outside, would 
they?  With the two-tier system, an administrator could have limited 
privileges when not physically at the console and full privileges while
at 
the console. 

Of course, logging in to the server through SSH, telnet, or some other 
remote terminal software defeats this kind of security check as the user

now appears to be at the local terminal. Oh, well. It is not perfect but

it is better than nothing at all!

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine



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



MySql and AOP?

2005-10-12 Thread Fernando Asteasuain


Hi:

I was visiting the Aspect Oriented Software Development (AOSD) -Europe 
Workshop 2005 website,
(http://www.aosd-europe.net/workshop-web/discussions.html) especially the 
discusion area. There, I read the following:

What is the state of application of AOSD especially in industry?
The exact extent of where AOSD tools and techniques are used is difficult to 
evaluate, in particular, because of its hidden nature as an enabling 
technology in applications. There are not many open-source projects that 
clearly feature AOSD techniques, notable exceptions being MySQL and AJ 
Hotdraw. Furthermore, eight commercial IBM products currently include AOSD 
libraries. 

Is MySql  implemented using AOSD technology? How they are related? I wasn´t 
aware of this.

Thanks, Fernando.

 


-
This mail sent through IMP: http://horde.org/imp/

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



re: possible bug in mysql 5.0.13

2005-10-12 Thread SGreen
James Black [EMAIL PROTECTED] wrote on 10/12/2005 09:57:51 AM:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Due to the complexity of my query I don't know how to get this down to a
 simple test case to demonstrate the error.
 
 This works under mysql 4.1.8 btw, so it is failing due to a change
 introduced recently.  It also worked under mysql 5.0.9, but I haven't
 tested any of the beta versions between 9 and 13.
 
 Any suggestions as to what I may look at to make this simpler?
 
 I will be working on it in the meantime, to see what I find.
 
 mysql INSERT INTO curuse(rid, start, badge, ip, card_type, fullname,
 dept, college, campus)
 SELECT 12612,1129124442, n.badge, 0,
 (SELECT role FROM nams.names WHERE badge=n.badge),
 (SELECT IF(p.fullname IS NULL,
 (SELECT CONCAT(sna.fname, ' ', sna.mname, ' ', sna.lname, ' ', sna.gen)
 FROM nams.names AS sna WHERE sna.badge=sne.badge), p.fullname) AS
 fullname FROM nams.netids AS sne LEFT OUTER JOIN nams.prefs AS p
 ON(sne.badge=p.badge) WHERE sne.netid='jblack') AS fullnameTable,
 (SELECT d.dabbr FROM nams.affiliations f, nams.roles r, nams.departments
 d WHERE f.role=r.code AND f.deptid=d.deptid AND f.badge=n.badge AND
 d.dabbr !='' ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1), (SELECT
 f.college FROM nams.affiliations f, nams.roles r, nams.colleges d WHERE
 f.role=r.code AND f.college=d.code AND f.badge=n.badge AND d.code !=''
 ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1), (SELECT f.campus FROM
 nams.affiliations f, nams.roles r, nams.departments d WHERE
 f.role=r.code AND f.deptid=d.deptid AND f.badge=n.badge AND d.dabbr !=''
 ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1) FROM items i,
 nams.netids n INNER JOIN nams.names AS na ON n.badge=na.badge INNER JOIN
 nams.affiliations AS a ON a.badge=na.badge INNER JOIN nams.roles AS r ON
 a.role=r.code
 
 LEFT OUTER JOIN curuse AS c ON (c.rid=i.rid)
 
 WHERE r.lmsvalid='Y' AND a.enddate IS NULL AND i.rid=1999 AND
 n.netid='jblack' AND (i.status='A' OR c.badge IS NULL) LIMIT 1;
 
 ERROR 1054 (42S22): Unknown column 'i.rid' in 'on clause'
 
 +--+--+--+-+-++
 | Field | Type | Null | Key | Default | Extra |
 +--+--+--+-+-++
 | rid | int(11)  | NO | PRI | NULL | auto_increment |
 | lid | int(11)  | NO | MUL | 0 | |
 | itemtype | char(4)  | NO | MUL | | |
 | label | char(12) | NO | UNI | | |
 | status | char(1)  | NO | | | |
 | layoutx | int(11)  | YES | | NULL | |
 | layouty | int(11)  | YES | | NULL | |
 | theta | int(11)  | YES | | NULL | |
 +--+--+--+-+-++
 8 rows in set (0.02 sec) mysql describe curuse;
 
 +---+-+--+-+-+---+
 | Field | Type | Null | Key | Default | Extra |
 +---+-+--+-+-+---+
 | rid | int(11)  | NO | PRI | 0 | |
 | start | int(11)  | NO | | 0 | |
 | badge | int(11)  | NO | MUL | 0 | |
 | card_type | char(2)  | NO | | | |
 | dept | char(3)  | NO | | | |
 | college | char(2)  | NO | | | |
 | campus | char(1)  | NO | || |
 | fullname | varchar(24) | NO | | | |
 | ip | varchar(40) | NO | PRI | ||
 | alive | int(11)  | NO | | 0 | |
 +---+-+--+-+-+---+
 10 rows in set (0.02 sec)
 - --
 Love is mutual self-giving that ends in self-recovery. Fulton Sheen
 James Black[EMAIL PROTECTED]
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.1 (MingW32)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
 iD8DBQFDTRZfikQgpVn8xrARAo5LAJ0fkAmKtxtMHHGWMY2kcnSOuXVCqQCbB4sH
 A4h+LzTgcZns66WLG2xOp9c=
 =YIgR
 -END PGP SIGNATURE-
 

Just to help the rest of us, here is his query reformatted only (no 
changes except for spacing and tabbing). Some of the longer CONCAT() 
functions will wrap but the majority of it should be much easier to read:

INSERT INTO curuse(
rid
, start
, badge
, ip
, card_type
, fullname
, dept
, college
, campus
)
SELECT 
12612
, 1129124442
, n.badge
, 0
, (SELECT role FROM nams.names WHERE badge=n.badge)
, (
SELECT IF(
p.fullname IS NULL
, (SELECT CONCAT(sna.fname, ' ', sna.mname, ' ', 
sna.lname, ' ', sna.gen)
FROM nams.names AS sna 
WHERE sna.badge=sne.badge
   )
, p.fullname) AS fullname 
FROM nams.netids AS sne 
LEFT OUTER JOIN nams.prefs AS p
ON (sne.badge=p.badge) 
WHERE sne.netid='jblack'
  ) AS fullnameTable
, (
SELECT d.dabbr 
FROM nams.affiliations f, nams.roles r, nams.departments d 

WHERE f.role=r.code 
AND f.deptid=d.deptid 
  

How to use logrotate to manage binary logs

2005-10-12 Thread Kristen G. Thorson

Hi all,

This may be a simple solution that I'm just not seeing.  logrotate has 
trouble with binlogs since the extension keeps changing, so instead of 
actually rotating logs out, I just get a dir filled with


binlog.001.1
binlog.002.1
binlog.003.1
binlog.004.1
binlog.005.1
binlog.006.1

and on to inifinity.  The manual says If you supply an extension in the 
log name (for example, |--log-bin=/|file_name.extension|/|), the 
extension is silently removed and ignored, so it appears I'm stuck.  
Does anyone have some pointer for me to set up auto-rotation?  I'm 
somehow not finding much info on this.



kgt


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



Re: Help with query

2005-10-12 Thread SGreen
Dušan Pavlica [EMAIL PROTECTED] wrote on 10/12/2005 10:00:53 AM:

 Thanks, Michal, for your help.
 Your query works as I need.
 I tried to use same syntax as in MS Access, but results are for some 
reason 
 different for this query. I'm working on application which should be 
able to 
 connect to MySQL or to MSAccess (users' choice) and I didn't want to 
write 
 querries for each DB system separately. Now I see that I will have to.
 
 Dusan
 
 - Original Message - 
 From: Michael Stassen [EMAIL PROTECTED]
 To: Dušan Pavlica [EMAIL PROTECTED]
 Cc: list mysql mysql@lists.mysql.com
 Sent: Wednesday, October 12, 2005 2:54 PM
 Subject: Re: Help with query
 
 
  Dušan Pavlica wrote:
  Hello,
 
  could someone help me please to construct correct query or tell me 
what 
  I'm doing wrong?
snip
  Kind regards,
  Dusan Pavlica
 
snip
  In any case, does this do what you want?
 
SELECT p.Description, p.ID, pp.Product_ID, pc.Code, pp.StartDate
FROM products_prices pp
JOIN products p ON p.ID = pp.Product_ID
LEFT JOIN products_codes pc ON p.ID = pc.Product_ID AND pc.CodeType 
= 1
WHERE StartDate  Now()
ORDER BY p.ID, pp.StartDate DESC;
 
  Michael
 
 

I don't think you will need to change anything. MS Access should be able 
to work with Michael's query just fine. Just because the Query Builder in 
Access (I despise the SQL that comes out of that tool) always nests its 
JOINs doesn't mean that MS Access can't use un-nested joins. Give it a 
shot, you may be surprised.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


Downgrade privileges on connect

2005-10-12 Thread Andrew_Hoying




Hello,

Is it possible for a MySQL connection to request a downgrade in privileges?
What I'd like to be able to do is create one database user account for a
database application with read and write privileges to the tables, but if
an application user logs in who only has read access, then to downgrade the
permission's on the SQL server for the database user to select only for
that connection. I want to be able to give an added level of assurance that
the user will not be able to write to the database even if the application
controls are circumvented. As it is now, I have to create multiple database
users and choose which one to connect to the database with based on the
application users authorization level.


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



syntax of bind_address

2005-10-12 Thread Daniel Schaerli
Hi,

How is the sintax to in my.cnf listen only to specified ip-addresses or 
ip-ranges? I tried:
bind_address 127.0.0.1 192.168.0.10 192.168.0.20
and
bind_address 127.0.0.1, 192.168.0.10, 192.168.0.20
and
bind_address 127.0.0.1 192
bind_address 192.168.0.10
bind_address 192.168.0.20
Non of them worked. Could anyone help me please?

Thanks in advance
Daniel

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



Re: How to use logrotate to manage binary logs

2005-10-12 Thread gerald_clark

Kristen G. Thorson wrote:


Hi all,

This may be a simple solution that I'm just not seeing.  logrotate has 
trouble with binlogs since the extension keeps changing, so instead of 
actually rotating logs out, I just get a dir filled with


binlog.001.1
binlog.002.1
binlog.003.1
binlog.004.1
binlog.005.1
binlog.006.1

and on to inifinity.  The manual says If you supply an extension in 
the log name (for example, |--log-bin=/|file_name.extension|/|), the 
extension is silently removed and ignored, so it appears I'm stuck.  
Does anyone have some pointer for me to set up auto-rotation?  I'm 
somehow not finding much info on this.



kgt



Don't do that. You will break replication.
Set up a cron job to flush logs instead.


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



Re: Non-linear degradation in bulk loads?

2005-10-12 Thread Heikki Tuuri

Jon,

hmm... maybe one of the indexes inevitably is in a random order.

Please post a typical

SHOW INNODB STATUS\G

when the inserts happen slowly.

What is your my.cnf like?

Regards,

Heikki
Innobase/Oracle

- Alkuperäinen viesti - 
Lähettäjä: Jon Frisby [EMAIL PROTECTED]
Vastaanottaja: Heikki Tuuri [EMAIL PROTECTED]; 
mysql@lists.mysql.com

Lähetetty: Wednesday, October 12, 2005 3:08 AM
Aihe: RE: Non-linear degradation in bulk loads?



Two solutions: 1) sort the rows to be inserted on the key
'email' before inserting.

2) Or:

http://dev.mysql.com/doc/mysql/en/innodb-tuning.html

If you have UNIQUE constraints on secondary keys, starting from MySQL
3.23.52 and 4.0.3, you can speed up table imports by
temporarily turning off the uniqueness checks during the
import session:
SET UNIQUE_CHECKS=0;

For big tables, this saves a lot of disk I/O because InnoDB
can use its insert buffer to write secondary index records in a batch.


But make sure you do not have any duplicates in the rows!


After sending my mail, I discovered SET UNIQUE_CHECKS=0, and subsequent
to that it also occurred to me to try putting the data in in sorted
order.  Unfortunately, doing UNIQUE_CHECKS=0 did not work, and even the
combination of both did not work.  First chunk (3.4m rows) was ~1.5
minutes, second was ~5 minutes...

At this point I'm inclined to believe that there is something very wrong
with the disk subsystem because of this and other problems (doing a
large cp from the datapool filesystem to another filesystem brought the
database to a near-halt, among other things).

As a stop-gap solution, I created the table with no indexes, and loaded
all the data (loaded in linear time), and plan on doing a CREATE UNIQUE
INDEX on the table.  Will this happen in linear time, or near-linear
time?

*sigh*

-JF 



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



Re: Downgrade privileges on connect

2005-10-12 Thread SGreen
[EMAIL PROTECTED] wrote on 10/12/2005 10:56:43 AM:

 
 
 
 
 Hello,
 
 Is it possible for a MySQL connection to request a downgrade in 
privileges?
 What I'd like to be able to do is create one database user account for a
 database application with read and write privileges to the tables, but 
if
 an application user logs in who only has read access, then to downgrade 
the
 permission's on the SQL server for the database user to select only for
 that connection. I want to be able to give an added level of assurance 
that
 the user will not be able to write to the database even if the 
application
 controls are circumvented. As it is now, I have to create multiple 
database
 users and choose which one to connect to the database with based on the
 application users authorization level.
 
 

So are you saying that you would rather have each user share a direct 
database login with other users (granting them certain common rights) or 
do you want each of your users to have their own separate database login? 
I really don't think you want either.

As you describe it, your application is in charge of authenticating each 
user (not the database). That means that each user only gets the 
privileges that the application lets them have. If your application's 
security structure is not set up to deny privileges based on their login, 
then your application is poorly designed.

Your application's users should not have ANY direct access to the database 
on the backend unless you give them a database login to connect with AND 
they have the ability to connect directly to the database. The account 
your users use to connect to your application should not be a mysql user 
account. That should be something setup as a separate table in a separate 
database. Having at least two logins for each application is a wise 
precaution. One login can have read-only privileges while the other can 
have read-write privileges. Those would be mysql logins. The users should 
not have access to that information.

Your security model should look something vaguely like this:

 |||  |||
database |||  application ||| user
server   |||  |||
  ^^
 mysql login  application login

That way the user never talks directly to the database. All user 
interaction with data is filtered and controlled by the application. The 
user should only have the ability to do things in the application that the 
user has been given privileges to do. It's the application's 
responsibility to act like a firewall between the user and the database. 

Now, don't do something dumb and put mysql logins and passwords as plain 
text into an application that you install on the user's system. It is SO 
easy to read through a compiled file and get all of the plain-text strings 
and try them out. What would be better is if your user's never even had 
access to the code that talks to the database (not even as a file on their 
system). 

Please write back if any part of this is unclear.  I know the Bureau of 
Land Management has had problems in the past securing certain user-facing 
applications and I, and I am sure many others on the list, would like to 
help to keep you as safe as possible. 

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Re: Downgrade privileges on connect

2005-10-12 Thread Scott Gifford
[EMAIL PROTECTED] writes:

 Is it possible for a MySQL connection to request a downgrade in
 privileges?  What I'd like to be able to do is create one database
 user account for a database application with read and write
 privileges to the tables, but if an application user logs in who
 only has read access, then to downgrade the permission's on the SQL
 server for the database user to select only for that connection.

I don't know of a way to do exactly what you describe, but you can get
the same effects by creating two accounts, one with only SELECT
privileges and one with whatever write privileges you need.  Then
you application can simply decide which account to authenticate with.

 I want to be able to give an added level of assurance that the user
 will not be able to write to the database even if the application
 controls are circumvented.

That sounds like an excellent design decision.

Scott.

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



Re: possible bug in mysql 5.0.13

2005-10-12 Thread Peter Brawley




James,

You can reproduce that error by writing ...

 SELECT ...
 FROM a, b INNER JOIN c ON a.x=c.y

The error goes away if you instead write ...

 SELECT ...
 FROM b, a INNER JOIN c ON A.x=c.y

so you might try swapping 
FROM items i
, nams.netids n 
PB

-

[EMAIL PROTECTED] wrote:

  James Black [EMAIL PROTECTED] wrote on 10/12/2005 09:57:51 AM:

  
  
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Due to the complexity of my query I don't know how to get this down to a
simple test case to demonstrate the error.

This works under mysql 4.1.8 btw, so it is failing due to a change
introduced recently.  It also worked under mysql 5.0.9, but I haven't
tested any of the beta versions between 9 and 13.

Any suggestions as to what I may look at to make this simpler?

I will be working on it in the meantime, to see what I find.

mysql INSERT INTO curuse(rid, start, badge, ip, card_type, fullname,
dept, college, campus)
SELECT 12612,1129124442, n.badge, 0,
(SELECT role FROM nams.names WHERE badge=n.badge),
(SELECT IF(p.fullname IS NULL,
(SELECT CONCAT(sna.fname, ' ', sna.mname, ' ', sna.lname, ' ', sna.gen)
FROM nams.names AS sna WHERE sna.badge=sne.badge), p.fullname) AS
fullname FROM nams.netids AS sne LEFT OUTER JOIN nams.prefs AS p
ON(sne.badge=p.badge) WHERE sne.netid='jblack') AS fullnameTable,
(SELECT d.dabbr FROM nams.affiliations f, nams.roles r, nams.departments
d WHERE f.role=r.code AND f.deptid=d.deptid AND f.badge=n.badge AND
d.dabbr !='' ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1), (SELECT
f.college FROM nams.affiliations f, nams.roles r, nams.colleges d WHERE
f.role=r.code AND f.college=d.code AND f.badge=n.badge AND d.code !=''
ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1), (SELECT f.campus FROM
nams.affiliations f, nams.roles r, nams.departments d WHERE
f.role=r.code AND f.deptid=d.deptid AND f.badge=n.badge AND d.dabbr !=''
ORDER BY r.priority DESC, f.orgdate DESC LIMIT 1) FROM items i,
nams.netids n INNER JOIN nams.names AS na ON n.badge=na.badge INNER JOIN
nams.affiliations AS a ON a.badge=na.badge INNER JOIN nams.roles AS r ON
a.role=r.code

LEFT OUTER JOIN curuse AS c ON (c.rid=i.rid)

WHERE r.lmsvalid='Y' AND a.enddate IS NULL AND i.rid=1999 AND
n.netid='jblack' AND (i.status='A' OR c.badge IS NULL) LIMIT 1;

ERROR 1054 (42S22): Unknown column 'i.rid' in 'on clause'

+--+--+--+-+-++
| Field | Type | Null | Key | Default | Extra |
+--+--+--+-+-++
| rid | int(11)  | NO | PRI | NULL | auto_increment |
| lid | int(11)  | NO | MUL | 0 | |
| itemtype | char(4)  | NO | MUL | | |
| label | char(12) | NO | UNI | | |
| status | char(1)  | NO | | | |
| layoutx | int(11)  | YES | | NULL | |
| layouty | int(11)  | YES | | NULL | |
| theta | int(11)  | YES | | NULL | |
+--+--+--+-+-++
8 rows in set (0.02 sec) mysql describe curuse;

+---+-+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+-+--+-+-+---+
| rid | int(11)  | NO | PRI | 0 | |
| start | int(11)  | NO | | 0 | |
| badge | int(11)  | NO | MUL | 0 | |
| card_type | char(2)  | NO | | | |
| dept | char(3)  | NO | | | |
| college | char(2)  | NO | | | |
| campus | char(1)  | NO | || |
| fullname | varchar(24) | NO | | | |
| ip | varchar(40) | NO | PRI | ||
| alive | int(11)  | NO | | 0 | |
+---+-+--+-+-+---+
10 rows in set (0.02 sec)
- --
"Love is mutual self-giving that ends in self-recovery." Fulton Sheen
James Black[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTRZfikQgpVn8xrARAo5LAJ0fkAmKtxtMHHGWMY2kcnSOuXVCqQCbB4sH
A4h+LzTgcZns66WLG2xOp9c=
=YIgR
-END PGP SIGNATURE-


  
  
Just to help the rest of us, here is his query reformatted only (no 
changes except for spacing and tabbing). Some of the longer CONCAT() 
functions will wrap but the majority of it should be much easier to read:

INSERT INTO curuse(
rid
, start
, badge
, ip
, card_type
, fullname
, dept
, college
, campus
)
SELECT 
12612
, 1129124442
, n.badge
, 0
, (SELECT role FROM nams.names WHERE badge=n.badge)
, (
SELECT IF(
p.fullname IS NULL
, (SELECT CONCAT(sna.fname, ' ', sna.mname, ' ', 
sna.lname, ' ', sna.gen)
FROM nams.names AS sna 
WHERE sna.badge=sne.badge
   )
, p.fullname) AS fullname 
FROM nams.netids AS sne 
LEFT OUTER JOIN nams.prefs AS p
ON (sne.badge=p.badge) 
WHERE sne.netid='jblack'
   

Re: Downgrade privileges on connect

2005-10-12 Thread Andrew_Hoying




What you describe is how I have it set up today. My thoughts on the matter
are that it makes more sense to maintain a single SQL user account for the
application with on password to manage, rather than two or three or four,
and then allow that SQL user, when the connection is made, what effective
privileges you want MySQL to allow to that connection. That way each
connection can have varying privileges without having multiple MySQL user
accounts.

Thanks again,
Andrew Hoying



   
 [EMAIL PROTECTED] 
   
 10/12/2005 09:20   To 
 AM[EMAIL PROTECTED]   
cc 
   mysql@lists.mysql.com   
   Subject 
   Re: Downgrade privileges on connect 
   
   
   
   
   
   






[EMAIL PROTECTED] wrote on 10/12/2005 10:56:43 AM:





 Hello,

 Is it possible for a MySQL connection to request a downgrade in
privileges?
 What I'd like to be able to do is create one database user account for a
 database application with read and write privileges to the tables, but if
 an application user logs in who only has read access, then to downgrade
the
 permission's on the SQL server for the database user to select only for
 that connection. I want to be able to give an added level of assurance
that
 the user will not be able to write to the database even if the
application
 controls are circumvented. As it is now, I have to create multiple
database
 users and choose which one to connect to the database with based on the
 application users authorization level.



So are you saying that you would rather have each user share a direct
database login with other users (granting them certain common rights) or do
you want each of your users to have their own separate database login? I
really don't think you want either.

As you describe it, your application is in charge of authenticating each
user (not the database). That means that each user only gets the privileges
that the application lets them have. If your application's security
structure is not set up to deny privileges based on their login, then your
application is poorly designed.

Your application's users should not have ANY direct access to the database
on the backend unless you give them a database login to connect with AND
they have the ability to connect directly to the database. The account your
users use to connect to your application should not be a mysql user
account. That should be something setup as a separate table in a separate
database. Having at least two logins for each application is a wise
precaution. One login can have read-only privileges while the other can
have read-write privileges. Those would be mysql logins. The users should
not have access to that information.

Your security model should look something vaguely like this:

 |||  |||
database |||  application ||| user
server   |||  |||
  ^^
 mysql login  application login

That way the user never talks directly to the database. All user
interaction with data is filtered and controlled by the application. The
user should only have the ability to do things in the application that the
user has been given privileges to do. It's the application's responsibility
to act like a firewall between the user and the database.

Now, don't do something dumb and put mysql logins and passwords as plain
text into an application that you install on the user's system. It is SO
easy to read through a compiled file and get all of the plain-text strings
and try them out. What would be better is if your user's never even had
access to the code that talks to the database (not even as a file on their
system).

Please write back if any part of this is unclear.  I know the Bureau of
Land Management has had problems in the past securing certain user-facing
applications and I, and I am sure many others on the list, would like to
help to keep you as safe as possible.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


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

Problems with creating of foreign key

2005-10-12 Thread Tatjana Cukic
hello,

does anybody knows the error:
can't create table '.\Cherry\#sql-288_5d.frm'
(errno:150)

it happens when i try to create foreign keys in
Table1, and that foreign key is actually primary key
in Table2 (to which i relate my foreign key)

Thanx a lot!

Tatjana



__ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

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



Re: MySql and AOP?

2005-10-12 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fernando Asteasuain wrote:
 
 Hi:
 
 I was visiting the Aspect Oriented Software Development (AOSD) -Europe 
 Workshop 2005 website,
 (http://www.aosd-europe.net/workshop-web/discussions.html) especially the 
 discusion area. There, I read the following:
 
 What is the state of application of AOSD especially in industry?
 The exact extent of where AOSD tools and techniques are used is difficult to 
 evaluate, in particular, because of its hidden nature as an enabling 
 technology in applications. There are not many open-source projects that 
 clearly feature AOSD techniques, notable exceptions being MySQL and AJ 
 Hotdraw. Furthermore, eight commercial IBM products currently include AOSD 
 libraries. 
 
 Is MySql  implemented using AOSD technology? How they are related? I wasn´t 
 aware of this.
 
 Thanks, Fernando.

Fernando,

The JDBC driver uses Aspect/J to weave in tracing aspects, if that's
what they're referring to. I'm not sure the server uses any technology
that could be considered aspects.

-Mark


- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTTm3tvXNTca6JD8RAq4UAJ4rUb5LtDj8mqTvunzFy0EFfg0FTACfRo+k
4bgDFPNQxRWIoFI4u4p/25w=
=suQZ
-END PGP SIGNATURE-

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



Re: Downgrade privileges on connect

2005-10-12 Thread SGreen
You are correct in that each mysql user account only has one set of 
permissions. Your application talks to the database and it may only need 
one login. One login = one set of permissions. When I am designing a 
web-based application, I always create at least two accounts. One will be 
read-only, the other read-write. All of the pages that do nothing but 
query the database (no inserts, updates, or deletes) use the read-only 
login.  Those pages that must somehow affect the data use the other one. 
Neither of my application's mysql accounts will have full admin rights to 
the entire server.

Each user authenticates with the application. It's your application that 
must downgrade the user's privileges to use the application's features. 
Your application will still need access to the data it gets from MySQL so 
changing your MySQL permissions doesn't make any sense, does it. It's your 
application that needs to say no to the user. You don't want MySQL 
saying no to your application. Do you?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


[EMAIL PROTECTED] wrote on 10/12/2005 12:26:54 PM:

 
 
 
 
 What you describe is how I have it set up today. My thoughts on the 
matter
 are that it makes more sense to maintain a single SQL user account for 
the
 application with on password to manage, rather than two or three or 
four,
 and then allow that SQL user, when the connection is made, what 
effective
 privileges you want MySQL to allow to that connection. That way each
 connection can have varying privileges without having multiple MySQL 
user
 accounts.
 
 Thanks again,
 Andrew Hoying
 
  
  [EMAIL PROTECTED]  
  
  10/12/2005 09:20 To 
  AM[EMAIL PROTECTED]  
 cc 
mysql@lists.mysql.com  
 Subject 
Re: Downgrade privileges on 
connect 
  
  
 
 
 [EMAIL PROTECTED] wrote on 10/12/2005 10:56:43 AM:
 
 
 
 
 
  Hello,
 
  Is it possible for a MySQL connection to request a downgrade in
 privileges?
  What I'd like to be able to do is create one database user account for 
a
  database application with read and write privileges to the tables, but 
if
  an application user logs in who only has read access, then to 
downgrade
 the
  permission's on the SQL server for the database user to select only 
for
  that connection. I want to be able to give an added level of assurance
 that
  the user will not be able to write to the database even if the
 application
  controls are circumvented. As it is now, I have to create multiple
 database
  users and choose which one to connect to the database with based on 
the
  application users authorization level.
 
 
 
 So are you saying that you would rather have each user share a direct
 database login with other users (granting them certain common rights) or 
do
 you want each of your users to have their own separate database login? I
 really don't think you want either.
 
 As you describe it, your application is in charge of authenticating each
 user (not the database). That means that each user only gets the 
privileges
 that the application lets them have. If your application's security
 structure is not set up to deny privileges based on their login, then 
your
 application is poorly designed.
 
 Your application's users should not have ANY direct access to the 
database
 on the backend unless you give them a database login to connect with AND
 they have the ability to connect directly to the database. The account 
your
 users use to connect to your application should not be a mysql user
 account. That should be something setup as a separate table in a 
separate
 database. Having at least two logins for each application is a wise
 precaution. One login can have read-only privileges while the other can
 have read-write privileges. Those would be mysql logins. The users 
should
 not have access to that information.
 
 Your security model should look something vaguely like this:
 
  |||  |||
 database |||  application ||| user
 server   |||  |||
   ^^
  mysql login  application login
 
 That way the user never talks directly to the database. All user
 interaction with data is filtered and controlled by the application. The
 user should only have the ability to do things in the application that 
the
 user has been given privileges to do. It's the application's 
responsibility
 to act like a firewall between the user and the database.
 
 Now, don't do something dumb and put mysql logins and passwords as plain
 text into an application that you install on the user's system. It is SO
 easy to read through a compiled file and get all of the plain-text 
strings
 and try them out. What would be better is if your user's never even had
 access to the code that talks to the database (not even as a file on 
their
 system).
 
 Please write back if any part of this 

Re: Problems with creating of foreign key

2005-10-12 Thread SGreen
Tatjana Cukic [EMAIL PROTECTED] wrote on 10/12/2005 12:28:47 PM:

 hello,
 
 does anybody knows the error:
 can't create table '.\Cherry\#sql-288_5d.frm'
 (errno:150)
 
 it happens when i try to create foreign keys in
 Table1, and that foreign key is actually primary key
 in Table2 (to which i relate my foreign key)
 
 Thanx a lot!
 
 Tatjana
 
 
 
 __ 
 Yahoo! Music Unlimited 
 Access over 1 million songs. Try it free.
 http://music.yahoo.com/unlimited/
 

For all InnoDB errors (like the one you show), you use

SHOW INNODB STATUS;

to get detailed information.

Quick rules to creating Foreign Keys (FKs):
a) Both tables must be InnoDB.
b) Both ends of the FK relationships must be indexed.

I would guess that you do not have the column in Table1 that references 
the FK from Table2 as a left-most column of any key.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


Re: Downgrade privileges on connect

2005-10-12 Thread Andrew_Hoying






[EMAIL PROTECTED] wrote on 10/12/2005 10:46:46 AM:


 You are correct in that each mysql user account only has one set of
 permissions. Your application talks to the database and it may only
 need one login. One login = one set of permissions. When I am
 designing a web-based application, I always create at least two
 accounts. One will be read-only, the other read-write. All of the
 pages that do nothing but query the database (no inserts, updates,
 or deletes) use the read-only login.  Those pages that must somehow
 affect the data use the other one. Neither of my application's mysql
 accounts will have full admin rights to the entire server.

Yes, and that is how the application is coded, as that has always been the
only way to do it.


 Each user authenticates with the application. It's your application
 that must downgrade the user's privileges to use the application's
 features. Your application will still need access to the data it
 gets from MySQL so changing your MySQL permissions doesn't make any
 sense, does it. It's your application that needs to say no to the
 user. You don't want MySQL saying no to your application. Do you?

Again, my concern is not normal operations, but the 'what if a user fuzzes
the data in a way that is completely new and unexpected in an attempt to
circumvent the controls of the application?'

For example, I have a database table editor, with some users having read
access to see the data, and some users having write access to add, modify
and delete the data. They use the same application, but users who are not
allowed to write do not get access to those functions, and the server code
verifies that a user has write access again before actually making any
changes in case of a modified post query, or other malicious activity. It
should be bulletproof, but I believe in security in depth and so for
read-only users I connect to the database with a SQL user that only has the
select privilege, and for read/write users I connect to the database with a
user with select,insert,update,delete privileges.

This all works fine, the only reason to change it would be to reduce the
number of SQL users an application requires. Then I could create one user
with select,insert,update,delete, for example, but when the connection is
established a SQL command could be issued requesting a downgrade of
privileges to select only.

It all comes down to having fewer application passwords to change on a
regular basis to stay current with security requirements.

I realize that there is probably no way to do that with the current MySQL
API, but perhaps it could be a feature request for future releases.

 Shawn Green
 Database Administrator
 Unimin Corporation - Spruce Pine



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



Re: MySql and AOP?

2005-10-12 Thread Fernando Asteasuain
Thanks por answering Mark!

By the way, how do you know that JDBC driver uses AspectJ?
I´ve vissited several jdbc web sites and i didn´t find this information.



Quoting Mark Matthews [EMAIL PROTECTED]:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Fernando Asteasuain wrote:
  
  Hi:
  
  I was visiting the Aspect Oriented Software Development (AOSD) -Europe 
  Workshop 2005 website,
  (http://www.aosd-europe.net/workshop-web/discussions.html) especially the 
  discusion area. There, I read the following:
  
  What is the state of application of AOSD especially in industry?
  The exact extent of where AOSD tools and techniques are used is difficult
 to 
  evaluate, in particular, because of its hidden nature as an enabling 
  technology in applications. There are not many open-source projects that 
  clearly feature AOSD techniques, notable exceptions being MySQL and AJ 
  Hotdraw. Furthermore, eight commercial IBM products currently include AOSD
 
  libraries. 
  
  Is MySql  implemented using AOSD technology? How they are related? I wasn´t
 
  aware of this.
  
  Thanks, Fernando.
 
 Fernando,
 
 The JDBC driver uses Aspect/J to weave in tracing aspects, if that's
 what they're referring to. I'm not sure the server uses any technology
 that could be considered aspects.
 
   -Mark
 
 
 - --
 Mark Matthews
 MySQL AB, Software Development Manager - Connectivity
 www.mysql.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.1 (MingW32)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
 iD8DBQFDTTm3tvXNTca6JD8RAq4UAJ4rUb5LtDj8mqTvunzFy0EFfg0FTACfRo+k
 4bgDFPNQxRWIoFI4u4p/25w=
 =suQZ
 -END PGP SIGNATURE-
 




-
This mail sent through IMP: http://horde.org/imp/

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



Re: MySql and AOP?

2005-10-12 Thread Alvaro Avello
probablemente por que mark es el manager del desarrollo de software de 
conectividad para Mysql...entre ellos jdbc.. :-)


Saludos,
Alvaro Avello.

Fernando Asteasuain wrote:


Thanks por answering Mark!

By the way, how do you know that JDBC driver uses AspectJ?
I´ve vissited several jdbc web sites and i didn´t find this information.



Quoting Mark Matthews [EMAIL PROTECTED]:

 


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fernando Asteasuain wrote:
   


Hi:

I was visiting the Aspect Oriented Software Development (AOSD) -Europe 
Workshop 2005 website,
(http://www.aosd-europe.net/workshop-web/discussions.html) especially the 
discusion area. There, I read the following:


What is the state of application of AOSD especially in industry?
The exact extent of where AOSD tools and techniques are used is difficult
 

to 
   

evaluate, in particular, because of its hidden nature as an enabling 
technology in applications. There are not many open-source projects that 
clearly feature AOSD techniques, notable exceptions being MySQL and AJ 
Hotdraw. Furthermore, eight commercial IBM products currently include AOSD
 


libraries. 

Is MySql  implemented using AOSD technology? How they are related? I wasn´t
 


aware of this.

Thanks, Fernando.
 


Fernando,

The JDBC driver uses Aspect/J to weave in tracing aspects, if that's
what they're referring to. I'm not sure the server uses any technology
that could be considered aspects.

-Mark


- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTTm3tvXNTca6JD8RAq4UAJ4rUb5LtDj8mqTvunzFy0EFfg0FTACfRo+k
4bgDFPNQxRWIoFI4u4p/25w=
=suQZ
-END PGP SIGNATURE-

   






-
This mail sent through IMP: http://horde.org/imp/

 



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



Re: MySql and AOP?

2005-10-12 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fernando Asteasuain wrote:
 Thanks por answering Mark!
 
 By the way, how do you know that JDBC driver uses AspectJ?
 I´ve vissited several jdbc web sites and i didn´t find this information.

Fernando,

Because I write/maintain the JDBC driver for MySQL and put the aspects
in there ;)

JDBC in general doesn't use aspects, but JDBC is just a bunch of
interfaces to be implemented by driver vendors.

-Mark
- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTUvvtvXNTca6JD8RAnNPAJ98XHV+IZYfCPrWIB5PVgtZslUngQCgklaY
gVfRHCUcjEfoepqJSGVLzcY=
=4taN
-END PGP SIGNATURE-

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



Re: possible bug in mysql 5.0.13

2005-10-12 Thread James Black
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter Brawley wrote:
 James,
 
 You can reproduce that error by writing ...
 
   SELECT ...
   FROM a, b INNER JOIN c ON a.x=c.y
 
 The error goes away if you instead write ...
 
   SELECT ...
   FROM b, a INNER JOIN c ON A.x=c.y

  I will try it. Thank you.

  Would this be a bug, or just something that should be documented?

- --
Love is mutual self-giving that ends in self-recovery. Fulton Sheen
James Black[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTUz7ikQgpVn8xrARArGNAJ9MrOEjMay9N4VirSvt9Zv/fZYE0ACfSOYD
wqshJve8wnUiZv0vWqVNrCc=
=Nhd7
-END PGP SIGNATURE-

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



Re: possible bug in mysql 5.0.13

2005-10-12 Thread James Black
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter Brawley wrote:
 James,
 
 You can reproduce that error by writing ...
 
   SELECT ...
   FROM a, b INNER JOIN c ON a.x=c.y
 
 The error goes away if you instead write ...
 
   SELECT ...
   FROM b, a INNER JOIN c ON A.x=c.y
 
 so you might try swapping
 
 FROM items i
 , nams.netids n 

  Tried that,now I get:
Unknown column 'n.badge'in 'on clause'

  So, whichever order I put them in, I get one of two errors.

  It appears that this bug will continue to break for me until it is
fixed in the next version, hopefully.

- --
Love is mutual self-giving that ends in self-recovery. Fulton Sheen
James Black[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTVCiikQgpVn8xrARAqGjAJ9y4/ym15QPZj8KVvbyuIkmTIKMKACfTlP9
cd7w92nB8uhOH2Y1+jAe4MU=
=FOcN
-END PGP SIGNATURE-

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



Re: Downgrade privileges on connect

2005-10-12 Thread Scott Gifford
[EMAIL PROTECTED] writes:

[...]

 Your application will still need access to the data it gets from
 MySQL so changing your MySQL permissions doesn't make any sense,
 does it. It's your application that needs to say no to the
 user. You don't want MySQL saying no to your application. Do you?

Having multiple layers of security is generally a good design (often
called Security in depth or Defense in depth).  That way if
there's a flaw in your application, the damage is limited.  If you
think that's unlikely to happen, then you're not paying attention:

http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=sql+injection

ScottG.

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



Re: possible bug in mysql 5.0.13

2005-10-12 Thread SGreen
James Black [EMAIL PROTECTED] wrote on 10/12/2005 02:06:26 PM:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Peter Brawley wrote:
  James,
  
  You can reproduce that error by writing ...
  
SELECT ...
FROM a, b INNER JOIN c ON a.x=c.y
  
  The error goes away if you instead write ...
  
SELECT ...
FROM b, a INNER JOIN c ON A.x=c.y
  
  so you might try swapping
  
  FROM items i
  , nams.netids n 
 
   Tried that,now I get:
 Unknown column 'n.badge'in 'on clause'
 
   So, whichever order I put them in, I get one of two errors.
 
   It appears that this bug will continue to break for me until it is
 fixed in the next version, hopefully.
 
 - --
 Love is mutual self-giving that ends in self-recovery. Fulton Sheen
 James Black[EMAIL PROTECTED]
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.1 (MingW32)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
 iD8DBQFDTVCiikQgpVn8xrARAqGjAJ9y4/ym15QPZj8KVvbyuIkmTIKMKACfTlP9
 cd7w92nB8uhOH2Y1+jAe4MU=
 =FOcN
 -END PGP SIGNATURE-


What if, instead of using a comma, you use an explicit INNER JOIN? It's 
perfectly valid to leave out the ON clause of an INNER JOIN (creating a 
Cartesian product).  I mention this because you don't seem to have a term 
to use in an ON clause, unless you want to move the term n.netid='jblack' 
from the WHERE clause. 

SELECT...
FROM items i
INNER JOIN nams.netids n
INNER JOIN ...
...

Does the problem remain? If it goes away, this would be useful information 
to include in your bug report.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Re: possible bug in mysql 5.0.13

2005-10-12 Thread James Black
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] wrote:

 SELECT...
 FROM items i
 INNER JOIN nams.netids n
 INNER JOIN ...
 ...

 Does the problem remain? If it goes away, this would be useful information 
 to include in your bug report.

  Thank you for the suggestion, but it led to an error of:
Unknown column r.rid in on clause.

  Guess I will start working on creating a test db where I can
demonstrate this bug, to make it easy to reproduce.

- --
Love is mutual self-giving that ends in self-recovery. Fulton Sheen
James Black[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTWgMikQgpVn8xrARAnaTAKCHTQDzZtL2Iwh09iwFZhKX6kJ3PACgi8u5
mFNisss5Yc4k/WlicBTG5lM=
=Worc
-END PGP SIGNATURE-

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



Re: possible bug in mysql 5.0.13

2005-10-12 Thread Peter Brawley




James,

Both ...

 SELECT ...
 FROM a, b LEFT JOIN c ON a.x=c.y

and

 SELECT ...
 FROM a 
 LEFT JOIN B USING (x )
 LEFT JOIN c ON a.x=c.y

work up to and including version 5.0.10, not in 5.0.11, 12 or 13. 

http://bugs.mysql.com/bug.php?id=13832 reports...

"The two statements below are quite different from one another:
1) SELECT * FROM t1, t2 LEFT JOIN t3 ON t1.a=t3.c
2) SELECT * FROM t1 JOIN t2 LEFT JOIN t3 ON t1.a=t3.c

"Statement (1) above will likely continue to give an "Unknown column
't1.a' in
'on clause'" error, while statement (2) will likely function correctly
at some
point in the future.

"This bug report is in reference to statements like statement (2), and
no bug
reports that use a statement like statement (1) are duplicates of this
bug."

The behaviour of (1) above is also verified
(http://bugs.mysql.com/bug.php?id=13551), and that page explains...

"This is a change that was made in 5.0.15 [sic] to make MySQL more
compliant with the standard. According to the SQL:2003

from clause ::= FROM table reference list
table reference list ::=
table reference [ { comma table reference }... ]
table reference ::=
table factor
| joined table
joined table ::=
cross join
| qualified join
| natural join
...

"Thus when you write

... FROM t1 , t2 LEFT JOIN t3 ON (expr)

it is parsed as

(1) ... FROM t1 , (t2 LEFT JOIN t3 ON (expr))

and not as

(2) ... FROM (t1 , t2) LEFT JOIN t3 ON (expr)

so, from expr you can only refer to columns of t2 and t3 - operands of
the join. Workaround - to put parentheses explicitly as in (2). Then
you can refer to t1 columns from expr.

Unfortunately, this change is not properly documented in the manual, it
will be fixed."

PB
http://www.artfulsoftware.com

-

[EMAIL PROTECTED] wrote:

  James Black [EMAIL PROTECTED] wrote on 10/12/2005 02:06:26 PM:

  
  
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter Brawley wrote:


  James,

You can reproduce that error by writing ...

  SELECT ...
  FROM a, b INNER JOIN c ON a.x=c.y

The error goes away if you instead write ...

  SELECT ...
  FROM b, a INNER JOIN c ON A.x=c.y

so you might try swapping

FROM items i
, nams.netids n 
  

  Tried that,now I get:
Unknown column 'n.badge'in 'on clause'

  So, whichever order I put them in, I get one of two errors.

  It appears that this bug will continue to break for me until it is
fixed in the next version, hopefully.

- --
"Love is mutual self-giving that ends in self-recovery." Fulton Sheen
James Black[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTVCiikQgpVn8xrARAqGjAJ9y4/ym15QPZj8KVvbyuIkmTIKMKACfTlP9
cd7w92nB8uhOH2Y1+jAe4MU=
=FOcN
-END PGP SIGNATURE-

  
  

What if, instead of using a comma, you use an explicit INNER JOIN? It's 
perfectly valid to leave out the ON clause of an INNER JOIN (creating a 
Cartesian product).  I mention this because you don't seem to have a term 
to use in an ON clause, unless you want to move the term n.netid='jblack' 
from the WHERE clause. 

SELECT...
FROM items i
INNER JOIN nams.netids n
INNER JOIN ...
...

Does the problem remain? If it goes away, this would be useful information 
to include in your bug report.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
  
  

No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.14/130 - Release Date: 10/12/2005

  



No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.14/130 - Release Date: 10/12/2005



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

ANTs Benefits as Oracle Acquires InnoDB

2005-10-12 Thread Desi Bay
I am not sure if you guys seen this:
http://www.msvistablog.net/news.php?item.82
http://www.ants.com/index.php?option=com_contenttask=viewItemid=29id=454

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: ANTs Benefits as Oracle Acquires InnoDB

2005-10-12 Thread Daniel Kasak

Desi Bay wrote:


I am not sure if you guys seen this:
http://www.msvistablog.net/news.php?item.82
http://www.ants.com/index.php?option=com_contenttask=viewItemid=29id=454
 

No, I haven't, but a trillion thanks for pointing it out. It doesn't 
surprise me in the least that there are spammers out there who are all 
too keen to capitalise on ( and add to ) the uncertainty that the Oracle 
acquisition has produced.


I think it's just a little bit to early for people to be flocking to 
some Ant server. In fact I would say that I expect precisely no-one to 
flock to some Ant server. If anything, a handful of people *might* 
consider Postgres, *if* and *when* this actually has some real effect on 
MySQL's products.


I did find it amusing that the Ants claim that their product is cheaper 
than open-source. I've heard that one before ...


Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
 


You damn well bet I'm tired of spam, current thread included.

--
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]



MySQL sw for reverse engineering

2005-10-12 Thread Bruno Cochofel
Does anyone know a sw that can reverse engineering a mysql table? I want to
be able to draw a entity-relationship model from an already made MySQL
table.

Thanks,
Bruno


Re: MySQL sw for reverse engineering

2005-10-12 Thread Graham Reeds

Bruno Cochofel wrote:

Does anyone know a sw that can reverse engineering a mysql table? I want to
be able to draw a entity-relationship model from an already made MySQL
table.

Thanks,
Bruno



There's MySQL Workbench here: http://forums.mysql.com/list.php?113 which 
is a bit shakey but will do that for you. I generally find it crashes 
when you close it (better than crashing when starting). Doesn't work on 
Linux yet.


Also people say great things about DBDesigner4 but I haven't used it to 
talk about it.


G.


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



Re: MySQL sw for reverse engineering

2005-10-12 Thread Peter Brawley

Bruno Cochofel wrote:

Does anyone know a sw that can reverse engineering a mysql table? I 
want to

be able to draw a entity-relationship model from an already made MySQL
table.

Dezign from Datanamic does a good job. MydbPal for Mysql is free and 
advertises reverse engineering; I haven't used it. MySQL Workbench is 
also free but not yet either full-featured or stable.


PB


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.14/130 - Release Date: 10/12/2005


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



Re: MySQL sw for reverse engineering

2005-10-12 Thread Edward Vermillion

Graham Reeds wrote:

Bruno Cochofel wrote:

Does anyone know a sw that can reverse engineering a mysql table? I 
want to

be able to draw a entity-relationship model from an already made MySQL
table.


[snip]



Also people say great things about DBDesigner4 but I haven't used it to 
talk about it.


G.




I use it (DBDesigner4) and it works good for me, but I'm not a DB expert 
so YMMV. The reverse engineering works great. I'm running it on Fedora 
Core 1 right now.


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



Tracking changes in the database

2005-10-12 Thread Andre Matos
Hi List,

I need to track the changes made in the database using the insert, update
and delete statements in MySQL 4.1.9. Can I use the Binary Log to get this
information or is there another better solution?

Thanks for any help.

Andre

-- 
Andre Matos
[EMAIL PROTECTED]



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



Re: Tracking changes in the database

2005-10-12 Thread Daniel Kasak

Andre Matos wrote:


Hi List,

I need to track the changes made in the database using the insert, update
and delete statements in MySQL 4.1.9. Can I use the Binary Log to get this
information or is there another better solution?

Thanks for any help.

Andre

 

The binary log is the recommended way. There's also a plain-text log, 
but you'll run into issues if you're using temporary tables, amongst 
other things. Also, the plain text log has been removed from 5.0.x ( I 
believe ). You can enable either with startup switches or with entries 
in the my.cnf file.


--
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]



Does the MySQL mailing list use MySQl to manage the mailing list?

2005-10-12 Thread Dave

MySQL General Discussion List,

   I am curious to know if the MySQL mailing list uses MySQL in 
managing the list and it's archives. The articles are surely archived in 
a database, and I would assume that if the MySQL developers were to use 
any database, it would be a MySQL one.
  What applications are used for management of this list? I like the 
way it is handled, and I have always been interested in having a mailing 
list manager that uses MySQL to keep track of members.


Dave

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



RE: Tracking changes in the database

2005-10-12 Thread Andre Matos
I am using InnoDB and replication, is there any issues?

Thanks.

Andre

--
Andre Matos
[EMAIL PROTECTED] 
-Original Message-
From: Daniel Kasak [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 13, 2005 1:01 AM
To: Andre Matos; 'mysql@lists.mysql.com '
Subject: Re: Tracking changes in the database

Andre Matos wrote:

Hi List,

I need to track the changes made in the database using the insert, update
and delete statements in MySQL 4.1.9. Can I use the Binary Log to get
this
information or is there another better solution?

Thanks for any help.

Andre

  

The binary log is the recommended way. There's also a plain-text log, 
but you'll run into issues if you're using temporary tables, amongst 
other things. Also, the plain text log has been removed from 5.0.x ( I 
believe ). You can enable either with startup switches or with entries 
in the my.cnf file.

-- 
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]